Skip to content

Instantly share code, notes, and snippets.

@ShivamJoker
Created December 31, 2019 15:29
Show Gist options
  • Save ShivamJoker/36cc2df6e00f8f532127d609cb522f98 to your computer and use it in GitHub Desktop.
Save ShivamJoker/36cc2df6e00f8f532127d609cb522f98 to your computer and use it in GitHub Desktop.
server {
# root /var/www/notifyer.xyz/html;
#index index.html index.htm index.nginx-debian.html;
server_name notifyer.xyz www.notifyer.xyz;
location / {
proxy_pass http://localhost:5000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
listen [::]:443 ssl ipv6only=on; # managed by Certbot
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/notifyer.xyz/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/notifyer.xyz/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
server {
location / {
return 301 https://$host$request_uri;
}
location /push/ {
proxy_pass http://localhost:5000;
}
if ($host = www.notifyer.xyz) {
#return 301 https://$host$request_uri;
} # managed by Certbot
if ($host = notifyer.xyz) {
# return 301 https://$host$request_uri;
} # managed by Certbot
server_name notifyer.xyz www.notifyer.xyz;
listen 80;
listen [::]:80;
# return 404; # managed by Certbot
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment