Last active
August 4, 2022 06:56
-
-
Save movibe/8adbc2a5e3193060010c162c6ecdcd68 to your computer and use it in GitHub Desktop.
Parse Server Nginx default
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# HTTP - redirect all requests to HTTPS | |
server { | |
listen 80; | |
listen [::]:80 default_server ipv6only=on; | |
return 301 https://$host$request_uri; | |
} | |
# HTTPS - serve HTML from /usr/share/nginx/html, proxy requests to /parse/ | |
# through to Parse Server | |
server { | |
listen 443 ssl; | |
server_name domain.com ; | |
root /usr/share/nginx/html; | |
index index.html index.htm; | |
ssl on; | |
# Use certificate and key provided by Let's Encrypt: | |
ssl_certificate /etc/letsencrypt/live/domain.com/fullchain.pem; | |
ssl_certificate_key /etc/letsencrypt/live/domain.com/privkey.pem; | |
ssl_session_timeout 5m; | |
ssl_protocols SSLv2 SSLv3 TLSv1; | |
ssl_ciphers HIGH:!aNULL:!MD5; | |
ssl_prefer_server_ciphers on; | |
# Pass requests for /parse/ to Parse Server instance at localhost:1337 | |
location / { | |
# prevents 502 bad gateway error | |
proxy_buffers 8 32k; | |
proxy_buffer_size 64k; | |
# redirect all HTTP traffic to localhost:8088; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header X-NginX-Proxy true; | |
proxy_pass http://0.0.0.0:1337/; | |
proxy_ssl_session_reuse off; | |
proxy_set_header Host $http_host; | |
proxy_redirect off; | |
# enables WS support | |
proxy_http_version 1.1; | |
proxy_set_header Upgrade $http_upgrade; | |
proxy_set_header Connection "upgrade"; | |
proxy_read_timeout 999999999; | |
} | |
#location / { | |
# try_files $uri $uri/ =404; | |
#} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you!! ❤️