Skip to content

Instantly share code, notes, and snippets.

@tlaitinen
Created April 23, 2018 08:57
Show Gist options
  • Select an option

  • Save tlaitinen/551873c75cd48eacbcabecda6aa3a3e7 to your computer and use it in GitHub Desktop.

Select an option

Save tlaitinen/551873c75cd48eacbcabecda6aa3a3e7 to your computer and use it in GitHub Desktop.
server {
listen 80;
server_name app.oma-domain.fi;
root /var/www;
location =/ {
rewrite ^ https://app.oma-domain.fi$request_uri? permanent;
}
}
server {
listen 443 ssl; # managed by Certbot
server_name app.oma-domain.fi;
root /data/app-frontend/current;
ssl_certificate /etc/letsencrypt/live/app.oma-domain.fi/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/app.oma-domain.fi/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
location / {
try_files $uri /index.html;
}
location /api/ {
rewrite ^/api/(.*) /$1 break;
proxy_pass http://localhost:3000;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment