Commit f3767990 authored by QueNenni's avatar QueNenni

conf nginx

parent 8f774165
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
client_max_body_size 3M;
location /favicon.ico {
alias /home/repanier/venv/favicon.ico;
}
location /robots.txt {
alias /home/repanier/venv/robots.txt;
}
listen 443 ssl http2;
listen [::]:443 ssl http2;
ssl on;
ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH';
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 1h;
ssl_dhparam /etc/nginx/ssl/dhparam.pem;
ssl_stapling on;
ssl_stapling_verify on;
resolver 8.8.8.8 8.8.4.4 valid=300s;
resolver_timeout 5s;
server {
listen 80;
server_name <ndd>;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
client_max_body_size 3M;
# Let's Encrypt certificates with Acmetool
location ^~ /.well-known/acme-challenge/ {
root /var/www/html/;
allow all;
default_type "text/plain";
try_files $uri /dev/null =404;
}
location /media/ {
alias <home>/<env>/<projet>/<projet>/media/public/;
}
location /static/ {
alias <home>/<env>/<projet>/<projet>/collect-static/;
}
location /favicon.ico {
alias <home>/<env>/<projet>/<projet>/collect-static/favicon.ico;
}
location /robots.txt {
alias <home>/<env>/<projet>/<projet>/collect-static/robots.txt;
}
location / {
include uwsgi_params;
uwsgi_param HTTP_X_FORWARDED_HOST $server_name:9000;
uwsgi_pass unix:///tmp/<projet>.sock;
uwsgi_read_timeout 600s;
uwsgi_send_timeout 60s;
uwsgi_connect_timeout 60s;
}
}
server {
listen 80;
listen [::]:80;
server_name <ndd>;
# Let's Encrypt certificates with Acmetool
location ^~ /.well-known/acme-challenge/ {
root /var/www/html/;
allow all;
default_type "text/plain";
try_files $uri /dev/null =404;
}
location / {
return 301 https://$host$request_uri;
}
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
}
server {
server_name <ndd>;
client_max_body_size 3M;
include /etc/nginx/sites-available/conf_communes_repanier_ssl.conf;
ssl_certificate /etc/letsencrypt/live/<ndd>/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/<ndd>/privkey.pem;
location /media/ {
alias <home>/<env>/<projet>/<projet>/media/public/;
}
location /static/ {
alias <home>/<env>/<projet>/<projet>/collect-static/;
}
location /favicon.ico {
alias <home>/<env>/<projet>/<projet>/collect-static/favicon.ico;
}
location /robots.txt {
alias <home>/<env>/<projet>/<projet>/collect-static/robots.txt;
}
location / {
include uwsgi_params;
uwsgi_param HTTP_X_FORWARDED_HOST $server_name;
uwsgi_pass unix:///tmp/<projet>.sock;
uwsgi_read_timeout 600s;
uwsgi_send_timeout 60s;
uwsgi_connect_timeout 60s;
}
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment