From 318e0bf508ac9ccc2c0076763d6eb28bc0a5ab0b Mon Sep 17 00:00:00 2001 From: Jason Kelly Date: Sun, 23 May 2021 14:27:02 +0800 Subject: [PATCH] Fixing nginx-config misunderstanding. --- nginx/development | 4 ++-- nginx/production | 61 ++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 62 insertions(+), 3 deletions(-) diff --git a/nginx/development b/nginx/development index cdc90df1..05b27c2b 100644 --- a/nginx/development +++ b/nginx/development @@ -1,3 +1,5 @@ +include /etc/nginx/conf.d/server_config; + upstream web { server web:8000; } @@ -5,8 +7,6 @@ upstream web { server { listen 80; - include /etc/nginx/conf.d/server_config; - location / { proxy_pass http://web; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; diff --git a/nginx/production b/nginx/production index 95225c26..54c84af4 100644 --- a/nginx/production +++ b/nginx/production @@ -1,3 +1,5 @@ +include /etc/nginx/conf.d/server_config; + upstream web { server web:8000; } @@ -6,10 +8,67 @@ server { listen [::]:80; listen 80; - include /etc/nginx/conf.d/server_config; + server_name your-domain.com www.your-domain.com; location ~ /.well-known/acme-challenge { allow all; root /var/www/certbot; } + +# # redirect http to https +# return 301 https://your-domain.com$request_uri; +# } +# +# server { +# listen [::]:443 ssl http2; +# listen 443 ssl http2; +# +# server_name your-domain.com; +# +# # SSL code +# ssl_certificate /etc/nginx/ssl/live/your-domain.com/fullchain.pem; +# ssl_certificate_key /etc/nginx/ssl/live/your-domain.com/privkey.pem; +# +# location ~ /.well-known/acme-challenge { +# allow all; +# root /var/www/certbot; +# } +# +# location / { +# proxy_pass http://web; +# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; +# proxy_set_header Host $host; +# proxy_redirect off; +# } +# +# location /images/ { +# alias /app/images/; +# } +# +# location /static/ { +# alias /app/static/; +# } } + +# Reverse-Proxy server +# server { +# listen [::]:8001; +# listen 8001; + +# server_name your-domain.com www.your-domain.com; + +# location / { +# proxy_pass http://web; +# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; +# proxy_set_header Host $host; +# proxy_redirect off; +# } + +# location /images/ { +# alias /app/images/; +# } + +# location /static/ { +# alias /app/static/; +# } +# }