Skip to content

Instantly share code, notes, and snippets.

@canadaduane
Created April 14, 2020 03:56
Show Gist options
  • Save canadaduane/18d3868e2a129fc75b78ca5139eaa1dc to your computer and use it in GitHub Desktop.
Save canadaduane/18d3868e2a129fc75b78ca5139eaa1dc to your computer and use it in GitHub Desktop.
nginx configuration for yjs over https reverse proxy
server {
listen 80 ;
# listen [::]:80 ipv6only=on;
root /var/www/html;
index index.php index.html index.htm;
server_name y.relm.us;
location / {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_pass http://localhost:1235;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_connect_timeout 7d;
proxy_send_timeout 7d;
proxy_read_timeout 7d;
}
error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/y.relm.us/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/y.relm.us/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
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment