How to setup nginx proxy?

Update nginx.conf file:

worker_processes 1;

events {
worker_connections 1024;
}

http {
include mime.types;
default_type application/octet-stream;

sendfile on;
keepalive_timeout 65;

server {
listen…


This content originally appeared on DEV Community and was authored by MUHAMMAD ARBAB ANJUM

Update nginx.conf file:

worker_processes  1;

events {
    worker_connections  1024;
}

http {
    include       mime.types;
    default_type  application/octet-stream;

    sendfile        on;
    keepalive_timeout  65;

    server {
        listen 443 ssl;
        server_name test.domain.com;

        ssl_certificate D:/nginx/ssl/cert.crt;
        ssl_certificate_key D:/nginx/ssl/priv.key;

        # Enable SSL protocols and settings
        ssl_protocols TLSv1.2 TLSv1.3;
        ssl_ciphers HIGH:!aNULL:!MD5;
        ssl_prefer_server_ciphers on;

        # Security headers
        add_header X-Content-Type-Options nosniff;
        # add_header X-Frame-Options DENY;  # (Commented out, uncomment if needed)
        add_header X-XSS-Protection "1; mode=block";

        location / {
            proxy_pass http://localhost:5000;
            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;

            # WebSocket support
            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection "upgrade";
        }
    }
}

Update Host:

127.0.0.1 -> test.domain.com


This content originally appeared on DEV Community and was authored by MUHAMMAD ARBAB ANJUM


Print Share Comment Cite Upload Translate Updates
APA

MUHAMMAD ARBAB ANJUM | Sciencx (2025-08-11T11:07:02+00:00) How to setup nginx proxy?. Retrieved from https://www.scien.cx/2025/08/11/how-to-setup-nginx-proxy/

MLA
" » How to setup nginx proxy?." MUHAMMAD ARBAB ANJUM | Sciencx - Monday August 11, 2025, https://www.scien.cx/2025/08/11/how-to-setup-nginx-proxy/
HARVARD
MUHAMMAD ARBAB ANJUM | Sciencx Monday August 11, 2025 » How to setup nginx proxy?., viewed ,<https://www.scien.cx/2025/08/11/how-to-setup-nginx-proxy/>
VANCOUVER
MUHAMMAD ARBAB ANJUM | Sciencx - » How to setup nginx proxy?. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2025/08/11/how-to-setup-nginx-proxy/
CHICAGO
" » How to setup nginx proxy?." MUHAMMAD ARBAB ANJUM | Sciencx - Accessed . https://www.scien.cx/2025/08/11/how-to-setup-nginx-proxy/
IEEE
" » How to setup nginx proxy?." MUHAMMAD ARBAB ANJUM | Sciencx [Online]. Available: https://www.scien.cx/2025/08/11/how-to-setup-nginx-proxy/. [Accessed: ]
rf:citation
» How to setup nginx proxy? | MUHAMMAD ARBAB ANJUM | Sciencx | https://www.scien.cx/2025/08/11/how-to-setup-nginx-proxy/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.