0% found this document useful (0 votes)
7 views1 page

Server Listen 80 Server

This document is a configuration for an Nginx server that redirects HTTP traffic to HTTPS and sets up SSL for the domain palmnaziresortcities.com. It includes settings for serving static files, proxying API requests to a local server, and handling WebSocket connections. The configuration ensures secure communication and proper routing of requests to the appropriate services.

Uploaded by

vickymuthunga
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views1 page

Server Listen 80 Server

This document is a configuration for an Nginx server that redirects HTTP traffic to HTTPS and sets up SSL for the domain palmnaziresortcities.com. It includes settings for serving static files, proxying API requests to a local server, and handling WebSocket connections. The configuration ensures secure communication and proper routing of requests to the appropriate services.

Uploaded by

vickymuthunga
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

server {

listen 80;
server_name palmnaziresortcities.com www.palmnaziresortcities.com;
return 301 https://$host$request_uri; # Redirect all HTTP to HTTPS
}

server {
listen 443 ssl;
server_name palmnaziresortcities.com www.palmnaziresortcities.com;

# SSL Configuration
ssl_certificate /etc/letsencrypt/live/palmnaziresortcities.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/palmnaziresortcities.com/privkey.pem;
include /etc/letsencrypt/options-ssl-nginx.conf;
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;

# Static Files
location / {
root /home/offline/PNRC/client/dist;
index index.html;
try_files $uri $uri/ /index.html;
}

# API Proxy
location /api {
proxy_pass http://localhost:3000;
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-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}

# WebSocket Proxy
location /socket.io/ {
proxy_pass http://localhost:3000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
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_cache_bypass $http_upgrade;
}
}

You might also like