Skip to content

Commit

Permalink
commented out prod nginx config
Browse files Browse the repository at this point in the history
  • Loading branch information
fulanii committed Dec 18, 2024
1 parent 9eb5280 commit 9faf50f
Showing 1 changed file with 60 additions and 60 deletions.
120 changes: 60 additions & 60 deletions nginx.conf
Original file line number Diff line number Diff line change
@@ -1,39 +1,3 @@
# user nginx;
# worker_processes auto;
# error_log /var/log/nginx/error.log warn;
# pid /var/run/nginx.pid;

# events {
# worker_connections 1024;
# }

# http {
# include /etc/nginx/mime.types;
# default_type application/octet-stream;
# sendfile on;
# keepalive_timeout 65;

# server {
# listen 80;
# server_name localhost;

# location / {
# proxy_pass http://web:8000;
# proxy_set_header Host $host;
# proxy_set_header X-Real-IP $remote_addr;
# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# }

# location /static/ {
# alias /staticfiles/;
# }
# }
# }


##### production ########
##### production ########

user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log warn;
Expand All @@ -48,44 +12,80 @@ http {
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server_tokens off; # Hides Nginx version for security

# Gzip compression for faster responses
gzip on;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;

server {
listen 80;
server_name autoblue.yassinecodes.dev www.autoblue.yassinecodes.dev;

# Redirect www to non-www version
if ($host = 'www.autoblue.yassinecodes.dev') {
return 301 http://autoblue.yassinecodes.dev$request_uri;
}
server_name localhost;

# Proxy pass to Django (Gunicorn)
location / {
# proxy_pass http://127.0.0.1:8000; # Adjust to your app's port
proxy_pass http://web:8000;
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;
}

# Serve static files
location /static/ {
alias /staticfiles/;
}
}
}

# # Serve media files
# location /media/ {
# alias /mediafiles/;
# }

# Security headers
add_header X-Content-Type-Options "nosniff";
add_header X-Frame-Options "DENY";
add_header X-XSS-Protection "1; mode=block";
}
##### production ########
##### production ########

user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;

events {
worker_connections 1024;
}

# http {
# include /etc/nginx/mime.types;
# default_type application/octet-stream;
# sendfile on;
# keepalive_timeout 65;
# server_tokens off; # Hides Nginx version for security

# # Gzip compression for faster responses
# gzip on;
# gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;

# server {
# listen 80;
# server_name autoblue.yassinecodes.dev www.autoblue.yassinecodes.dev;

# # Redirect www to non-www version
# if ($host = 'www.autoblue.yassinecodes.dev') {
# return 301 http://autoblue.yassinecodes.dev$request_uri;
# }

# # Proxy pass to Django (Gunicorn)
# location / {
# # proxy_pass http://127.0.0.1:8000; # Adjust to your app's port
# proxy_pass http://web:8000;
# 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;
# }

# # Serve static files
# location /static/ {
# alias /staticfiles/;
# }

# # # Serve media files
# # location /media/ {
# # alias /mediafiles/;
# # }

# # Security headers
# add_header X-Content-Type-Options "nosniff";
# add_header X-Frame-Options "DENY";
# add_header X-XSS-Protection "1; mode=block";
# }
# }

0 comments on commit 9faf50f

Please sign in to comment.