Update production nginx.conf to run all 3 sites on same hostname
This commit is contained in:
		
							parent
							
								
									1d542c15e4
								
							
						
					
					
						commit
						d92492eba6
					
				
							
								
								
									
										147
									
								
								nginx-wiz.conf
									
									
									
									
									
								
							
							
						
						
									
										147
									
								
								nginx-wiz.conf
									
									
									
									
									
								
							@ -1,5 +1,3 @@
 | 
				
			|||||||
user nobody;
 | 
					 | 
				
			||||||
pid /var/run/nginx.pid;
 | 
					 | 
				
			||||||
include /usr/local/etc/nginx/modules-enabled/*.conf;
 | 
					include /usr/local/etc/nginx/modules-enabled/*.conf;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
worker_processes auto;
 | 
					worker_processes auto;
 | 
				
			||||||
@ -36,18 +34,6 @@ http {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	gzip_types application/atom+xml application/javascript application/json application/ld+json application/manifest+json application/rss+xml application/vnd.geo+json application/vnd.ms-fontobject application/x-font-ttf application/x-web-app-manifest+json application/xhtml+xml application/xml font/opentype image/bmp image/svg+xml image/x-icon text/cache-manifest text/css text/plain text/vcard text/vnd.rim.location.xloc text/vtt text/x-component text/x-cross-domain-policy; # text/html is always compressed by gzip module
 | 
						gzip_types application/atom+xml application/javascript application/json application/ld+json application/manifest+json application/rss+xml application/vnd.geo+json application/vnd.ms-fontobject application/x-font-ttf application/x-web-app-manifest+json application/xhtml+xml application/xml font/opentype image/bmp image/svg+xml image/x-icon text/cache-manifest text/css text/plain text/vcard text/vnd.rim.location.xloc text/vtt text/x-component text/x-cross-domain-policy; # text/html is always compressed by gzip module
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	server {
 | 
					 | 
				
			||||||
		listen 80;
 | 
					 | 
				
			||||||
		listen [::]:80;
 | 
					 | 
				
			||||||
		server_name mempool.ninja;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		if ($host = mempool.ninja) {
 | 
					 | 
				
			||||||
			return 301 https://$host$request_uri;
 | 
					 | 
				
			||||||
		} # managed by Certbot
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		return 404; # managed by Certbot
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	server {
 | 
						server {
 | 
				
			||||||
		listen 80;
 | 
							listen 80;
 | 
				
			||||||
		listen [::]:80;
 | 
							listen [::]:80;
 | 
				
			||||||
@ -61,7 +47,18 @@ http {
 | 
				
			|||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	server {
 | 
						server {
 | 
				
			||||||
		listen 127.0.0.1:81;
 | 
							listen 80;
 | 
				
			||||||
 | 
							listen [::]:80;
 | 
				
			||||||
 | 
							server_name mempool.ninja;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							if ($host = mempool.ninja) {
 | 
				
			||||||
 | 
								return 301 https://mempool.space$request_uri;
 | 
				
			||||||
 | 
							} # managed by Certbot
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							return 404; # managed by Certbot
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						server {
 | 
				
			||||||
		listen [::]:443 ssl http2; # managed by Certbot
 | 
							listen [::]:443 ssl http2; # managed by Certbot
 | 
				
			||||||
		listen 443 ssl http2; # managed by Certbot
 | 
							listen 443 ssl http2; # managed by Certbot
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -70,78 +67,9 @@ http {
 | 
				
			|||||||
		include /usr/local/etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
 | 
							include /usr/local/etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
 | 
				
			||||||
		ssl_dhparam /usr/local/etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
 | 
							ssl_dhparam /usr/local/etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		root /mempool/public_html/mainnet/;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		index index.html index.htm index.nginx-debian.html;
 | 
					 | 
				
			||||||
		server_name mempool.ninja; # managed by Certbot
 | 
							server_name mempool.ninja; # managed by Certbot
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		location / {
 | 
							return 301 https://mempool.space$request_uri;
 | 
				
			||||||
			try_files $uri $uri/ /index.html =404;
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		location /webhook {
 | 
					 | 
				
			||||||
			proxy_pass http://127.0.0.1:2222/;
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		location /api {
 | 
					 | 
				
			||||||
			proxy_pass http://127.0.0.1:8999/api;
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		location /api/mainnet {
 | 
					 | 
				
			||||||
			proxy_pass http://127.0.0.1:8999/api;
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		location /api/liquid {
 | 
					 | 
				
			||||||
			proxy_pass http://127.0.0.1:8998/api;
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		location /api/testnet {
 | 
					 | 
				
			||||||
			proxy_pass http://127.0.0.1:8997/api;
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		location /electrs/ {
 | 
					 | 
				
			||||||
			proxy_pass http://[::1]:3000/;
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		location /electrs/mainnet/ {
 | 
					 | 
				
			||||||
			proxy_pass http://[::1]:3000/;
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		location /electrs/liquid/ {
 | 
					 | 
				
			||||||
			proxy_pass http://[::1]:3001/;
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		location /electrs/testnet/ {
 | 
					 | 
				
			||||||
			proxy_pass http://[::1]:3002/;
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		location /ws {
 | 
					 | 
				
			||||||
			proxy_pass http://127.0.0.1:8999/;
 | 
					 | 
				
			||||||
			proxy_http_version 1.1;
 | 
					 | 
				
			||||||
			proxy_set_header Upgrade $http_upgrade;
 | 
					 | 
				
			||||||
			proxy_set_header Connection "Upgrade";
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		location /ws/mainnet {
 | 
					 | 
				
			||||||
			proxy_pass http://127.0.0.1:8999/;
 | 
					 | 
				
			||||||
			proxy_http_version 1.1;
 | 
					 | 
				
			||||||
			proxy_set_header Upgrade $http_upgrade;
 | 
					 | 
				
			||||||
			proxy_set_header Connection "Upgrade";
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		location /ws/liquid {
 | 
					 | 
				
			||||||
			proxy_pass http://127.0.0.1:8998/;
 | 
					 | 
				
			||||||
			proxy_http_version 1.1;
 | 
					 | 
				
			||||||
			proxy_set_header Upgrade $http_upgrade;
 | 
					 | 
				
			||||||
			proxy_set_header Connection "Upgrade";
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		location /ws/testnet {
 | 
					 | 
				
			||||||
			proxy_pass http://127.0.0.1:8997/;
 | 
					 | 
				
			||||||
			proxy_http_version 1.1;
 | 
					 | 
				
			||||||
			proxy_set_header Upgrade $http_upgrade;
 | 
					 | 
				
			||||||
			proxy_set_header Connection "Upgrade";
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	server {
 | 
						server {
 | 
				
			||||||
@ -150,14 +78,13 @@ http {
 | 
				
			|||||||
		server_name liquid.mempool.ninja;
 | 
							server_name liquid.mempool.ninja;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		if ($host = liquid.mempool.ninja) {
 | 
							if ($host = liquid.mempool.ninja) {
 | 
				
			||||||
			return 301 https://$host$request_uri;
 | 
								return 301 https://mempool.space/liquid$request_uri;
 | 
				
			||||||
		} # managed by Certbot
 | 
							} # managed by Certbot
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		return 404; # managed by Certbot
 | 
							return 404; # managed by Certbot
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	server {
 | 
						server {
 | 
				
			||||||
		listen 127.0.0.1:81;
 | 
					 | 
				
			||||||
		listen [::]:443 ssl http2; # managed by Certbot
 | 
							listen [::]:443 ssl http2; # managed by Certbot
 | 
				
			||||||
		listen 443 ssl http2; # managed by Certbot
 | 
							listen 443 ssl http2; # managed by Certbot
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -166,29 +93,9 @@ http {
 | 
				
			|||||||
		include /usr/local/etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
 | 
							include /usr/local/etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
 | 
				
			||||||
		ssl_dhparam /usr/local/etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
 | 
							ssl_dhparam /usr/local/etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		root /mempool/public_html/liquid/;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		index index.html index.htm index.nginx-debian.html;
 | 
					 | 
				
			||||||
		server_name liquid.mempool.ninja; # managed by Certbot
 | 
							server_name liquid.mempool.ninja; # managed by Certbot
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		location / {
 | 
							return 301 https://mempool.space/liquid$request_uri;
 | 
				
			||||||
			try_files $uri $uri/ /index.html =404;
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		location /api {
 | 
					 | 
				
			||||||
			proxy_pass http://127.0.0.1:8998/api;
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		location /electrs/ {
 | 
					 | 
				
			||||||
			proxy_pass http://[::1]:3001/;
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		location /ws {
 | 
					 | 
				
			||||||
			proxy_pass http://127.0.0.1:8998/;
 | 
					 | 
				
			||||||
			proxy_http_version 1.1;
 | 
					 | 
				
			||||||
			proxy_set_header Upgrade $http_upgrade;
 | 
					 | 
				
			||||||
			proxy_set_header Connection "Upgrade";
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	server {
 | 
						server {
 | 
				
			||||||
@ -197,14 +104,13 @@ http {
 | 
				
			|||||||
		server_name testnet.mempool.ninja;
 | 
							server_name testnet.mempool.ninja;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		if ($host = testnet.mempool.ninja) {
 | 
							if ($host = testnet.mempool.ninja) {
 | 
				
			||||||
			return 301 https://$host$request_uri;
 | 
								return 301 https://mempool.space/testnet$request_uri;
 | 
				
			||||||
		} # managed by Certbot
 | 
							} # managed by Certbot
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		return 404; # managed by Certbot
 | 
							return 404; # managed by Certbot
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	server {
 | 
						server {
 | 
				
			||||||
		listen 127.0.0.1:81;
 | 
					 | 
				
			||||||
		listen [::]:443 ssl http2; # managed by Certbot
 | 
							listen [::]:443 ssl http2; # managed by Certbot
 | 
				
			||||||
		listen 443 ssl http2; # managed by Certbot
 | 
							listen 443 ssl http2; # managed by Certbot
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -213,30 +119,11 @@ http {
 | 
				
			|||||||
		include /usr/local/etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
 | 
							include /usr/local/etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
 | 
				
			||||||
		ssl_dhparam /usr/local/etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
 | 
							ssl_dhparam /usr/local/etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		root /mempool/public_html/testnet/;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		index index.html index.htm index.nginx-debian.html;
 | 
					 | 
				
			||||||
		server_name testnet.mempool.ninja; # managed by Certbot
 | 
							server_name testnet.mempool.ninja; # managed by Certbot
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		location / {
 | 
							return 301 https://mempool.space/testnet$request_uri;
 | 
				
			||||||
			try_files $uri $uri/ /index.html =404;
 | 
					 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		location /api {
 | 
					 | 
				
			||||||
			proxy_pass http://127.0.0.1:8997/api;
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		location /electrs/ {
 | 
					 | 
				
			||||||
			proxy_pass http://[::1]:3002/;
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		location /ws {
 | 
					 | 
				
			||||||
			proxy_pass http://127.0.0.1:8997/;
 | 
					 | 
				
			||||||
			proxy_http_version 1.1;
 | 
					 | 
				
			||||||
			proxy_set_header Upgrade $http_upgrade;
 | 
					 | 
				
			||||||
			proxy_set_header Connection "Upgrade";
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
	server {
 | 
						server {
 | 
				
			||||||
		listen 127.0.0.1:81;
 | 
							listen 127.0.0.1:81;
 | 
				
			||||||
		listen [::]:443 ssl default http2; # managed by Certbot
 | 
							listen [::]:443 ssl default http2; # managed by Certbot
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user