Skip to content

Commit

Permalink
Fix nginx prod.conf.
Browse files Browse the repository at this point in the history
  • Loading branch information
elarsaks committed Feb 10, 2024
1 parent a07df07 commit ae36f0e
Showing 1 changed file with 45 additions and 46 deletions.
91 changes: 45 additions & 46 deletions apps/nginx/production.conf
Original file line number Diff line number Diff line change
@@ -1,57 +1,56 @@
events {
worker_connections 1024;
}

# Server block for HTTP (Port 80)
server {
listen 80;
server_name gorilla-labs.com www.gorilla-labs.com;
http {

# Redirect HTTP to HTTPS
return 301 https://$server_name$request_uri;
# Server block for HTTP (Port 80)
server {
listen 80;
server_name gorilla-labs.com www.gorilla-labs.com;

location / {
proxy_pass http://gorilla-labs-client:3000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
error_page 502 =200 /placeholder.html;
# Redirect HTTP to HTTPS
return 301 https://$server_name$request_uri;
}
}

# Server block for HTTPS (Port 443)
server {
listen 443 ssl;
server_name gorilla-labs.com www.gorilla-labs.com;

# Strong SSL Security
ssl_protocols TLSv1.2 TLSv1.3;
ssl_prefer_server_ciphers on;
ssl_ciphers "ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384";
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 10m;

ssl_certificate /etc/nginx/ssl/certificate.crt;
ssl_certificate_key /etc/nginx/ssl/private.key;

location / {
proxy_pass http://gorilla-labs-client:3000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
error_page 502 =200 /placeholder.html;
}
# Server block for HTTPS (Port 443)
server {
listen 443 ssl;
server_name gorilla-labs.com www.gorilla-labs.com;

}
# Strong SSL Security
ssl_protocols TLSv1.2 TLSv1.3;
ssl_prefer_server_ciphers on;
ssl_ciphers "ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384";
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 10m;

ssl_certificate /etc/nginx/ssl/certificate.crt;
ssl_certificate_key /etc/nginx/ssl/private.key;

# HTTPS Server Block for Port 5000 (Forwarding to 4000)
server {
listen 5000 ssl;
server_name localhost;
location / {
proxy_pass http://gorilla-labs-client:3000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
error_page 502 =200 /placeholder.html;
}

ssl_certificate /etc/nginx/ssl/certificate.crt;
ssl_certificate_key /etc/nginx/ssl/private.key;
}

location / {
proxy_pass http://gorilla-labs-api:4000;
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;
# HTTPS Server Block for Port 5000 (Forwarding to 4000)
server {
listen 5000 ssl;
server_name localhost;

ssl_certificate /etc/nginx/ssl/certificate.crt;
ssl_certificate_key /etc/nginx/ssl/private.key;

location / {
proxy_pass http://gorilla-labs-api:4000;
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;
}
}
}

0 comments on commit ae36f0e

Please sign in to comment.