oldnginxcode
-> % cat /etc/nginx/sites-available/zserver
server { servername zainezq.com;
accesslog /var/log/nginx/zserver.access.log combined; errorlog /var/log/nginx/zserver.error.log warn;
authbasic “Restricted Access”; authbasicuserfile etc/nginx.htpasswd;
location / { proxysetheader Host $host; proxysetheader X-Real-IP $remoteaddr; proxysetheader X-Forwarded-For $proxyaddxforwardedfor; proxysetheader X-Forwarded-Proto $scheme; proxyredirect off;
root home/zaine/master-folder/orgfiles/orgweb/output; index index.html index.htm; tryfiles $uri $uri =404; }
location /nginxstatus { stubstatus; }
location dockge { proxypass http://127.0.0.1:5021/; proxysetheader Host $host; proxysetheader X-Real-IP $remoteaddr; proxysetheader X-Forwarded-For $proxyaddxforwardedfor; proxysetheader X-Forwarded-Proto $scheme; }
location guac { proxypass http://127.0.0.1:3003/guacamole/; proxyhttpversion 1.1;
proxysetheader Host $host; proxysetheader X-Real-IP $remoteaddr; proxysetheader X-Forwarded-For $proxyaddxforwardedfor; proxysetheader X-Forwarded-Proto $scheme;
proxysetheader Upgrade $httpupgrade; proxysetheader Connection $connectionupgrade; }
location pgadmin4 { proxysetheader X-Script-Name /pgadmin4; proxysetheader Host $host; proxypass http://127.0.0.1:5050; proxyredirect off; }
location pdf { proxypass http://127.0.0.1:8002/pdf/; proxysetheader X-Script-Name /pdf; proxysetheader X-Real-IP $remoteaddr; proxysetheader X-Forwarded-For $proxyaddxforwardedfor; proxysetheader Host $host; proxyredirect off; }
location /calibre { proxybind $serveraddr; proxypass http://127.0.0.1:8083; proxysetheader Host $httphost; proxysetheader X-Forwarded-For $proxyaddxforwardedfor; proxysetheader X-Scheme $scheme; proxysetheader X-Script-Name /calibre; # IMPORTANT: path has NO trailing slash
proxyredirect off; proxyhttpversion 1.1; clientmaxbodysize 100M; }
location codeserver { proxypass http://localhost:8441/; rewrite ^/codeserver(/.*)$ $1 break;
proxysetheader Host $host; proxysetheader Upgrade $httpupgrade; proxysetheader Connection “upgrade”; proxysetheader Accept-Encoding gzip; proxysetheader X-Real-IP $remoteaddr; proxysetheader X-Forwarded-For $proxyaddxforwardedfor; proxysetheader X-Forwarded-Proto $scheme; }
location /filebrowser {
proxybuffers 8 32k; proxybuffersize 64k;
clientmaxbodysize 75M;
proxypass http://127.0.0.1:9991; proxysetheader X-Real-IP $remoteaddr; proxysetheader Host $httphost; proxysetheader X-Forwarded-For $proxyaddxforwardedfor; #proxysetheader X-NginX-Proxy true;
proxyhttpversion 1.1; proxysetheader Upgrade $httpupgrade; proxysetheader Connection “upgrade”;
proxyreadtimeout 999999999; }
location miniflux { proxysetheader Host $host; proxysetheader X-Real-IP $remoteaddr; proxysetheader X-Forwarded-For $proxyaddxforwardedfor; proxysetheader X-Forwarded-Proto $scheme; proxypass http://127.0.0.1:9433/miniflux/; proxyredirect off; }
location jupyter { proxysetheader Host $host; proxysetheader X-Real-IP $remoteaddr; proxysetheader X-Forwarded-For $proxyaddxforwardedfor; proxysetheader X-Forwarded-Proto $scheme; proxypass http://127.0.0.1:8888/jupyter/; proxyredirect off;
proxyhttpversion 1.1; proxysetheader Upgrade $httpupgrade; proxysetheader Connection “Upgrade”; }
location portainer { proxypass https://localhost:9443/; proxysslverify off; # Because Portainer uses a self-signed cert by default proxysetheader Host $host; proxysetheader X-Real-IP $remoteaddr; proxysetheader X-Forwarded-For $proxyaddxforwardedfor; proxysetheader X-Forwarded-Proto $scheme; proxysetheader Authorization “”;
proxyhttpversion 1.1; proxysetheader Upgrade $httpupgrade; proxysetheader Connection “upgrade”;
rewrite ^/portainer(/.*)$ $1 break; }
location wireguard { proxypass http://127.0.0.1:124/; proxyhttpversion 1.1; proxysetheader Upgrade $httpupgrade; proxysetheader Connection “Upgrade”; proxysetheader Host $host; proxysetheader X-Real-IP $remoteaddr; proxysetheader X-Forwarded-For $proxyaddxforwardedfor; proxysetheader X-Forwarded-Proto $scheme;
proxysetheader Accept-Encoding “”; subfilter ’href=“’ ’href="/wireguard’; subfilter ’src=”’ ’src="/wireguard’; subfiltertypes text/css application/javascript; subfilteronce off; }
location = password { return 301 /password; }
location ^~ password { authbasic off;
proxyhttpversion 1.1; proxysetheader Host $host; proxysetheader X-Real-IP $remoteaddr; proxysetheader X-Forwarded-For $proxyaddxforwardedfor; proxysetheader X-Forwarded-Proto $scheme;
proxysetheader Upgrade $httpupgrade; proxysetheader Connection “upgrade”;
proxypass http://127.0.0.1:8006; }
location ^~ /password/notifications/hub { authbasic off;
proxyhttpversion 1.1; proxysetheader Upgrade $httpupgrade; proxysetheader Connection “upgrade”; proxysetheader Host $host;
proxypass http://127.0.0.1:8006; }
errorpage 500 502 503 504 /50x.html; location = /50x.html { root /usr/share/nginx/html; }
location ~ /\. { deny all; }
listen 443 ssl; # managed by Certbot sslcertificate /etc/letsencrypt/live/zainezq.com-0001/fullchain.pem; # managed by Certbot sslcertificatekey /etc/letsencrypt/live/zainezq.com-0001/privkey.pem; # managed by Certbot include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot ssldhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
server { if ($host = zserver.zapto.org) { return 301 https://$host$request_uri; } # managed by Certbot
listen 80; servername zserver.zapto.org; return 404; # managed by Certbot }
Backlinks