Skip to content

Instantly share code, notes, and snippets.

@fahadsiddiqui
Created June 2, 2020 20:34
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 fahadsiddiqui/78f7aae2e779f12a3751b7c9fd9d52bf to your computer and use it in GitHub Desktop.
Save fahadsiddiqui/78f7aae2e779f12a3751b7c9fd9d52bf to your computer and use it in GitHub Desktop.
Nginx configuration for v1 server.
server {
root /var/www/v1.polymerapp.io/html;
index index.html index.htm index.nginx-debian.html;
server_name v1.polymerapp.io;
location / {
try_files $uri $uri/ /index.html $uri/ =404;
}
location /gsheets {
rewrite /gsheets/address /api/gsheets/address break;
rewrite /gsheets/upload /api/gsheets/upload break;
proxy_pass http://localhost:9094;
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/v1.polymerapp.io/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/v1.polymerapp.io/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 {
if ($host = v1.polymerapp.io) {
return 301 https://$host$request_uri;
}
listen 80;
listen [::]:80;
server_name v1.polymerapp.io;
return 404; # managed by Certbot
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment