| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- # Upstream component nginx needs to connect to.
- upstream django {
- server unix:///opt/h0v1n8-website-env/website/website.sock; # For production file socket
- #server 127.0.0.1:8001; # Web port socket for use with uwsgi-hello-world-test.py
- }
- # HTTPS redirect
- server {
- listen 80 default_server;
- listen [::]:80 default_server;
- server_name _;
- #return 301 https://h0v1n8.nl$request_uri;
- return 301 https://$request;
- }
- # RotBot redirect. rotbot.h0v1n8.nl is the pointer record for the vps, so the bot looks cooler on IRC.
- server {
- listen 443 ssl;
- listen [::]:443 ssl;
- server_name rotbot.h0v1n8.nl;
- ssl_certificate /etc/letsencrypt/live/h0v1n8.nl/fullchain.pem;
- ssl_certificate_key /etc/letsencrypt/live/h0v1n8.nl/privkey.pem;
- return 301 https://h0v1n8.nl/rotbot$request_uri;
- }
- # Configuration of the server
- server {
- # the port your site will be served on
- listen 443 ssl;
- listen [::]:443 ssl;
- # the domain name it will serve for
- server_name h0v1n8.nl www.h0v1n8.nl; # substitute your machine's IP address or FQDN
- ssl_certificate /etc/letsencrypt/live/h0v1n8.nl/fullchain.pem;
- ssl_certificate_key /etc/letsencrypt/live/h0v1n8.nl/privkey.pem;
- charset utf-8;
- # max upload size
- client_max_body_size 75M; # adjust to taste
- # Django media
- #location /media {
- # alias /path/to/your/mysite/media; # your Django project's media files - amend as required
- #}
- location /static {
- alias /srv/www/static; # your Django project's static files - amend as required
- }
- # Finally, send all non-media requests to the Django server.
- location / {
- uwsgi_pass django;
- include /opt/h0v1n8-website-env/uwsgi_params; # the uwsgi_params file you installed
- }
- }
|