Files
peya-nodejs-pool/deployment/nginx-ssl-example.conf
2020-02-10 15:49:40 -05:00

40 lines
1.1 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# HTTP — redirect all traffic to HTTPS
server {
listen 80;
listen [::]:80 ipv6only=on;
server_name YOURDOMAIN;
return 301 https://$host$request_uri;
}
# HTTPS — proxy all requests to the pool app
server {
# Enable HTTP/2
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name YOURDOMAIN;
# Use the Lets Encrypt certificates
ssl_certificate /etc/letsencrypt/live/YOURDOMAIN/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/YOURDOMAIN/privkey.pem;
include /etc/letsencrypt/options-ssl-nginx.conf;
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
# Set files location
root /path/to/pool/website/;
index index.html;
location / {
try_files $uri $uri/ =404;
}
# Set API proxy
location ~ ^/api/(.*) {
proxy_pass http://127.0.0.1:8117/$1$is_args$args;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}