diff --git a/MUOR/MUOR/configs/muor.conf b/MUOR/MUOR/configs/muor.conf index bc1c74884..4b1d858d9 100644 --- a/MUOR/MUOR/configs/muor.conf +++ b/MUOR/MUOR/configs/muor.conf @@ -5,8 +5,6 @@ map $http_upgrade $connection_upgrade { upstream django { server localhost:8080; -# server unix:///home/randomsec/RandomSec/uwsgi-file/muor.sock; - } @@ -20,25 +18,14 @@ server { return 404; } -# configuration of the server server { - # the port your site will be served on listen 443 ssl http2 reuseport; - # the domain name it will serve for server_name randomsec.projektstudencki.pl charset utf-8; # max upload size client_max_body_size 75M; # adjust to taste -# location /static { -# alias /path/to/static; #TODO add path -# expires 30d; -# access_log off; -# add_header Pragma public; -# add_header Cache-Control "public"; -# } - error_page 502 /loader.html; location = /loader.html { @@ -46,7 +33,7 @@ server { } location /static/ { - alias /home/randomsec/RandomSec/MUOR/staticfiles/; # your Django project's static files - amend as required + alias /home/randomsec/RandomSec/MUOR/staticfiles/; expires 2d; access_log off; add_header Pragma public; @@ -54,20 +41,14 @@ server { } location /logout/ { -# uwsgi_pass django; -# include /etc/nginx/uwsgi_params; - proxy_pass http://django; # TODO prolly change that to uwsgi_pass + proxy_pass http://django; } - # Finally, send all non-media requests to the Django server. location / { - proxy_pass http://django; # TODO prolly change that to uwsgi_pass + proxy_pass http://django; if ($cookie_sessionid = ""){ - proxy_pass http://django; # TODO prolly change that to uwsgi_pass -# uwsgi_pass django; -# include /etc/nginx/uwsgi_params; - + proxy_pass http://django; } } @@ -77,6 +58,5 @@ server { include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot - # add_header Strict-Transport-Security max-age=31536000; } \ No newline at end of file diff --git a/MUOR/MUOR/configs/muor_after_location_block.conf b/MUOR/MUOR/configs/muor_after_location_block.conf index 5cb053f1f..3a86af766 100644 --- a/MUOR/MUOR/configs/muor_after_location_block.conf +++ b/MUOR/MUOR/configs/muor_after_location_block.conf @@ -1,8 +1,6 @@ if ($cookie_sessionid = ""){ - proxy_pass http://django; # TODO prolly change that to uwsgi_pass -# uwsgi_pass django; -# include /etc/nginx/uwsgi_params; + proxy_pass http://django; } } @@ -11,6 +9,5 @@ include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot - # add_header Strict-Transport-Security max-age=31536000; } \ No newline at end of file diff --git a/MUOR/MUOR/configs/muor_before_location_block.conf b/MUOR/MUOR/configs/muor_before_location_block.conf index a05bf65f8..5acda5d3c 100644 --- a/MUOR/MUOR/configs/muor_before_location_block.conf +++ b/MUOR/MUOR/configs/muor_before_location_block.conf @@ -1,16 +1,13 @@ - - map $http_upgrade $connection_upgrade { default upgrade; '' close; } upstream django { -# server unix:///home/randomsec/RandomSec/uwsgi-file/muor.sock; server localhost:8080; - } + server { if ($host = randomsec.projektstudencki.pl) { return 301 https://$host$request_uri; @@ -21,25 +18,14 @@ server { return 404; } -# configuration of the server server { - # the port your site will be served on listen 443 ssl http2 reuseport; - # the domain name it will serve for server_name randomsec.projektstudencki.pl charset utf-8; # max upload size client_max_body_size 75M; # adjust to taste -# location /static { -# alias /path/to/static; #TODO add path -# expires 30d; -# access_log off; -# add_header Pragma public; -# add_header Cache-Control "public"; -# } - error_page 502 /loader.html; location = /loader.html { @@ -47,7 +33,7 @@ server { } location /static/ { - alias /home/randomsec/RandomSec/MUOR/staticfiles/; # your Django project's static files - amend as required + alias /home/randomsec/RandomSec/MUOR/staticfiles/; expires 2d; access_log off; add_header Pragma public; @@ -55,12 +41,9 @@ server { } location /logout/ { -# uwsgi_pass django; -# include /etc/nginx/uwsgi_params; - proxy_pass http://django; # TODO prolly change that to uwsgi_pass + proxy_pass http://django; } - # Finally, send all non-media requests to the Django server. location / { - proxy_pass http://django; # TODO prolly change that to uwsgi_pass + proxy_pass http://django;