Skip to content

Instantly share code, notes, and snippets.

@weex
Created July 23, 2021 05:50
Show Gist options
  • Save weex/013ed3f295b4a741c6768cd90213fc50 to your computer and use it in GitHub Desktop.
Save weex/013ed3f295b4a741c6768cd90213fc50 to your computer and use it in GitHub Desktop.
nginx config o3
server {
root /var/www/o3.davidsterry.com/ft;
index index.html index.htm index.nginx-debian.html;
server_name o3.davidsterry.com www.o3.davidsterry.com;
location /public/ {
alias /var/www/o3.davidsterry.com/ft/public/;
gzip_static on;
expires max;
add_header Cache-Control public;
}
location / {
proxy_pass http://127.0.0.1:3000;
try_files $uri $uri/ =404;
}
listen [::]:443 ssl ipv6only=on; # managed by Certbot
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/o3.davidsterry.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/o3.davidsterry.com/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 = o3.davidsterry.com) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80;
listen [::]:80;
server_name o3.davidsterry.com www.o3.davidsterry.com;
return 404; # managed by Certbot
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment