Skip to content

Instantly share code, notes, and snippets.

@danieldeusing
Last active May 7, 2020 17:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danieldeusing/0b74981825c03c2e8aebf0799084835c to your computer and use it in GitHub Desktop.
Save danieldeusing/0b74981825c03c2e8aebf0799084835c to your computer and use it in GitHub Desktop.
server {
listen 443 ssl;
listen [::]:443 ssl;
include snippets/self-signed.conf;
include snippets/ssl-params.conf;
server_name promonco.local;
root /var/www/html;
index index.html;
location / {
proxy_set_header X-Forwarded-Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_http_version 1.1;
# to proxy WebSockets in nginx
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_pass http://localhost:8080;
proxy_pass_header Sec-Websocket-Extensions;
}
location /internal-nginx-static-location/ {
alias /var/www/html/httpdocs;
add_header X-Powered-By PleskLin;
internal;
}
}
server {
listen 8443 ssl;
listen [::]:8443 ssl;
include snippets/self-signed.conf;
include snippets/ssl-params.conf;
server_name promonco.local;
root /var/www/html;
index index.html;
location / {
proxy_set_header X-Forwarded-Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_http_version 1.1;
# to proxy WebSockets in nginx
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_pass http://localhost:8081;
proxy_pass_header Sec-Websocket-Extensions;
}
location /internal-nginx-static-location/ {
alias /var/www/html/httpdocs;
add_header X-Powered-By PleskLin;
internal;
}
}
server {
if ($host = promonco.local) {
return 301 https://$host$request_uri;
}
listen 80;
server_name promonco.local;
return 404;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment