nginx config and docker compose ports fix
This commit is contained in:
parent
10be7092e3
commit
6cd864bbb1
2 changed files with 43 additions and 1 deletions
|
|
@ -6,7 +6,7 @@ services:
|
||||||
environment:
|
environment:
|
||||||
WSGI_FILE: "sciodog.wsgi"
|
WSGI_FILE: "sciodog.wsgi"
|
||||||
HOSTNAME: "sciodog.fr"
|
HOSTNAME: "sciodog.fr"
|
||||||
PORT: 80
|
PORT: 8000
|
||||||
ports:
|
ports:
|
||||||
- "8000:8000"
|
- "8000:8000"
|
||||||
restart: always
|
restart: always
|
||||||
|
|
|
||||||
42
nginx/default
Normal file
42
nginx/default
Normal file
|
|
@ -0,0 +1,42 @@
|
||||||
|
server {
|
||||||
|
|
||||||
|
root /var/www/sciodog.fr;
|
||||||
|
|
||||||
|
index index.html index.htm index.nginx-debian.html;
|
||||||
|
|
||||||
|
server_name sciodog.fr;
|
||||||
|
|
||||||
|
location / {
|
||||||
|
proxy_set_header Host $host;
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
|
||||||
|
proxy_pass http://localhost:8000;
|
||||||
|
}
|
||||||
|
|
||||||
|
location /static/ {
|
||||||
|
root /var/www/sciodog.fr/blog/;
|
||||||
|
}
|
||||||
|
|
||||||
|
listen [::]:443 ssl ipv6only=on; # managed by Certbot
|
||||||
|
listen 443 ssl; # managed by Certbot
|
||||||
|
ssl_certificate /etc/letsencrypt/live/sciodog.fr/fullchain.pem; # managed by Certbot
|
||||||
|
ssl_certificate_key /etc/letsencrypt/live/sciodog.fr/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
|
||||||
|
|
||||||
|
}
|
||||||
|
server {
|
||||||
|
if ($host = sciodog.fr) {
|
||||||
|
return 301 https://$host$request_uri;
|
||||||
|
} # managed by Certbot
|
||||||
|
|
||||||
|
|
||||||
|
listen 80 default_server;
|
||||||
|
listen [::]:80 default_server;
|
||||||
|
|
||||||
|
server_name sciodog.fr;
|
||||||
|
return 404; # managed by Certbot
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue