How can I configure Nginx as a reverse proxy on Windows Server 2022 to route traffic through an external IP

I am working on a project where I need to set up Nginx as a reverse proxy on Windows Server 2022. My goal is to configure Nginx so that when users access a specific port (25400) on my server, they see the content from https://example.com, but with traffic routed through an external IP address instead of my server’s IP address.

What I have tried:

I have attempted to configure Nginx with the following settings:

Listening on port 25400
Proxying requests to https://example.com
SSL configurations and various headers
However, I am unsure how to ensure that the traffic to https://example.com is routed through the external IP address and not directly through my server’s IP.

How can I configure Nginx to achieve this setup where the content from https://example.com is routed through an external IP address?

Additional Details:

Nginx version: [your version here]
External IP address: [provide the IP or note if not yet configured]
Any guidance or examples would be greatly appreciated!

nginx.conf :

        worker_processes 1;
        pid logs/nginx.pid;

        events {
            worker_connections 1024;
        }

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

            server {
            listen 25400;

            location / {
                proxy_pass https://www.example.com;

                proxy_buffers 8 16k;
                proxy_buffer_size 32k;

                proxy_ssl_server_name on;
                proxy_ssl_verify on;
                proxy_ssl_verify_depth 2;
                
                proxy_ssl_trusted_certificate ca-certificates.crt;

                proxy_ssl_certificate cert.pem;
                proxy_ssl_certificate_key cert.key;

                proxy_redirect off;
                proxy_intercept_errors on;
                proxy_hide_header Location;
                proxy_hide_header Refresh;
                proxy_hide_header Strict-Transport-Security;
                proxy_cookie_domain www.example.com localhost;
                proxy_cookie_path / /;
                proxy_cookie_flags ~ Secure HttpOnly SameSite=None;
                add_header Cache-Control "no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0";
                add_header Pragma "no-cache";
                add_header Expires "0";
                sub_filter '<meta http-equiv="refresh"' '<!-- removed meta refresh -->';
                sub_filter 'https://www.example.com' 'http://localhost:25400';
                sub_filter_once off;
                add_header Access-Control-Allow-Origin *;
                add_header Access-Control-Allow-Methods 'GET, POST, OPTIONS';
                add_header Access-Control-Allow-Headers 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range';
                add_header Access-Control-Expose-Headers 'Content-Length,Content-Range';
                if ($request_method = OPTIONS) {
                    add_header Access-Control-Allow-Origin *;
                    add_header Access-Control-Allow-Methods 'GET, POST, OPTIONS';
                    add_header Access-Control-Allow-Headers 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range';
                    add_header Access-Control-Max-Age 1728000;
                    return 204;
                }
                proxy_connect_timeout 120s;
                proxy_read_timeout 300s;
                proxy_send_timeout 300s;
                gzip on;
                gzip_types text/plain text/css application/javascript application/json application/xml text/xml text/javascript;
                gzip_vary on;
                proxy_buffering off;
            }

            location @no_redirects {
                return 200 "Redirect Blocked!";
            }

            location ~* .(js|css|png|jpg|jpeg|gif|ico|svg)$ {
                expires off;
                add_header Cache-Control "no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0";
                proxy_pass https://www.example.com;
                proxy_hide_header Cache-Control;
            }
            
            location ~* .svg$ {
                proxy_pass https://www.example.com;
                proxy_hide_header Cache-Control;
            }
          }
        }

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa

How can I configure Nginx as a reverse proxy on Windows Server 2022 to route traffic through an external IP

I am working on a project where I need to set up Nginx as a reverse proxy on Windows Server 2022. My goal is to configure Nginx so that when users access a specific port (25400) on my server, they see the content from https://example.com, but with traffic routed through an external IP address instead of my server’s IP address.

What I have tried:

I have attempted to configure Nginx with the following settings:

Listening on port 25400
Proxying requests to https://example.com
SSL configurations and various headers
However, I am unsure how to ensure that the traffic to https://example.com is routed through the external IP address and not directly through my server’s IP.

How can I configure Nginx to achieve this setup where the content from https://example.com is routed through an external IP address?

Additional Details:

Nginx version: [your version here]
External IP address: [provide the IP or note if not yet configured]
Any guidance or examples would be greatly appreciated!

nginx.conf :

        worker_processes 1;
        pid logs/nginx.pid;

        events {
            worker_connections 1024;
        }

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

            server {
            listen 25400;

            location / {
                proxy_pass https://www.example.com;

                proxy_buffers 8 16k;
                proxy_buffer_size 32k;

                proxy_ssl_server_name on;
                proxy_ssl_verify on;
                proxy_ssl_verify_depth 2;
                
                proxy_ssl_trusted_certificate ca-certificates.crt;

                proxy_ssl_certificate cert.pem;
                proxy_ssl_certificate_key cert.key;

                proxy_redirect off;
                proxy_intercept_errors on;
                proxy_hide_header Location;
                proxy_hide_header Refresh;
                proxy_hide_header Strict-Transport-Security;
                proxy_cookie_domain www.example.com localhost;
                proxy_cookie_path / /;
                proxy_cookie_flags ~ Secure HttpOnly SameSite=None;
                add_header Cache-Control "no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0";
                add_header Pragma "no-cache";
                add_header Expires "0";
                sub_filter '<meta http-equiv="refresh"' '<!-- removed meta refresh -->';
                sub_filter 'https://www.example.com' 'http://localhost:25400';
                sub_filter_once off;
                add_header Access-Control-Allow-Origin *;
                add_header Access-Control-Allow-Methods 'GET, POST, OPTIONS';
                add_header Access-Control-Allow-Headers 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range';
                add_header Access-Control-Expose-Headers 'Content-Length,Content-Range';
                if ($request_method = OPTIONS) {
                    add_header Access-Control-Allow-Origin *;
                    add_header Access-Control-Allow-Methods 'GET, POST, OPTIONS';
                    add_header Access-Control-Allow-Headers 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range';
                    add_header Access-Control-Max-Age 1728000;
                    return 204;
                }
                proxy_connect_timeout 120s;
                proxy_read_timeout 300s;
                proxy_send_timeout 300s;
                gzip on;
                gzip_types text/plain text/css application/javascript application/json application/xml text/xml text/javascript;
                gzip_vary on;
                proxy_buffering off;
            }

            location @no_redirects {
                return 200 "Redirect Blocked!";
            }

            location ~* .(js|css|png|jpg|jpeg|gif|ico|svg)$ {
                expires off;
                add_header Cache-Control "no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0";
                proxy_pass https://www.example.com;
                proxy_hide_header Cache-Control;
            }
            
            location ~* .svg$ {
                proxy_pass https://www.example.com;
                proxy_hide_header Cache-Control;
            }
          }
        }

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật