Created
July 12, 2023 10:46
-
-
Save mcnemesis/f824840ef5eec745d880bf2ac6163d55 to your computer and use it in GitHub Desktop.
Sample Nginx Server Config for Serving Django App running on hidden/local network Apache instance with/without SSL
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
# OUR SERVER | |
server { | |
listen 80; | |
server_name .domain.com; | |
return 301 https://domain.com$request_uri; | |
} | |
server { | |
listen 443; | |
ssl_certificate_key /etc/letsencrypt/live/domain.com/privkey.pem; | |
ssl_certificate /etc/letsencrypt/live/domain.com/fullchain.pem; | |
ssl on; | |
server_name domain.com; | |
proxy_set_header Host $host; | |
client_max_body_size 100M; | |
proxy_connect_timeout 600; | |
proxy_send_timeout 600; | |
proxy_read_timeout 600; | |
send_timeout 600; | |
location / { | |
proxy_pass http://127.0.0.1:8888/; | |
proxy_cache off; | |
} | |
location ~ /favicon.png { | |
root /var/www/; | |
} | |
location ~ /favicon.ico { | |
root /var/www/; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment