Skip to content

Commit

Permalink
Update nginx.conf
Browse files Browse the repository at this point in the history
  • Loading branch information
tnaccarato committed Aug 11, 2024
1 parent 4e9f746 commit 1a62403
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions nginx.conf
Original file line number Diff line number Diff line change
@@ -1,27 +1,31 @@
server {
listen 443 ssl;
server_name _; # Replace with your domain name or IP address
server_name _;

ssl_certificate /etc/nginx/ssl/cert.pem;
ssl_certificate_key /etc/nginx/ssl/key.pem;

location / {
proxy_pass http://web:8000; # Proxy to the Django service
proxy_pass https://web:8000; # Use HTTPS here
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_set_header X-Forwarded-Proto $scheme;
proxy_ssl_verify off; # Disable SSL verification if using self-signed certs
}

location /static/ {
alias /app/vis-phewas/staticfiles/; # Adjust the path to your static files
alias /app/staticfiles/;
}

location /media/ {
alias /app/media/;
}
}

server {
listen 80;
server_name _; # Replace with your domain name or IP address
server_name _;

location / {
return 301 https://$host$request_uri;
Expand Down

0 comments on commit 1a62403

Please sign in to comment.