Skip to main content
edited body; edited title
Source Link

How to reverse proxy in Nginx with suffixprefix?

I'm using Nginx to serve a webapp.

I need to reverse proxy all the URL's with the suffixprefix ws

I tried the following Nginx configuration but it's not woking :

server { server_name example.com www.example.com; listen 80; listen [::]:80; return 301 https://www.example.com$request_uri; } server { listen 443 ssl; server_name example.com www.example.com; ssl_certificate /home/aspuser/ssl/example.crt; ssl_certificate_key /home/aspuser/ssl/example.key; access_log /var/log/nginx/reverse-access.log; error_log /var/log/nginx/reverse-error.log; location /ws { proxy_pass https://localhost:8443; } } 

I'm getting the error : HTTP ERROR 404, the page can’t be found.

I'm sure the underlying application is working because when in the config file, if I change the location to simply location / it works. However I need it for the pages with the suffixprefix ws.

Can anyone help please ?

Thanks,

How to reverse proxy in Nginx with suffix?

I'm using Nginx to serve a webapp.

I need to reverse proxy all the URL's with the suffix ws

I tried the following Nginx configuration but it's not woking :

server { server_name example.com www.example.com; listen 80; listen [::]:80; return 301 https://www.example.com$request_uri; } server { listen 443 ssl; server_name example.com www.example.com; ssl_certificate /home/aspuser/ssl/example.crt; ssl_certificate_key /home/aspuser/ssl/example.key; access_log /var/log/nginx/reverse-access.log; error_log /var/log/nginx/reverse-error.log; location /ws { proxy_pass https://localhost:8443; } } 

I'm getting the error : HTTP ERROR 404, the page can’t be found.

I'm sure the underlying application is working because when in the config file, if I change the location to simply location / it works. However I need it for the pages with the suffix ws.

Can anyone help please ?

Thanks,

How to reverse proxy in Nginx with prefix?

I'm using Nginx to serve a webapp.

I need to reverse proxy all the URL's with the prefix ws

I tried the following Nginx configuration but it's not woking :

server { server_name example.com www.example.com; listen 80; listen [::]:80; return 301 https://www.example.com$request_uri; } server { listen 443 ssl; server_name example.com www.example.com; ssl_certificate /home/aspuser/ssl/example.crt; ssl_certificate_key /home/aspuser/ssl/example.key; access_log /var/log/nginx/reverse-access.log; error_log /var/log/nginx/reverse-error.log; location /ws { proxy_pass https://localhost:8443; } } 

I'm getting the error : HTTP ERROR 404, the page can’t be found.

I'm sure the underlying application is working because when in the config file, if I change the location to simply location / it works. However I need it for the pages with the prefix ws.

Can anyone help please ?

Thanks,

Source Link

How to reverse proxy in Nginx with suffix?

I'm using Nginx to serve a webapp.

I need to reverse proxy all the URL's with the suffix ws

I tried the following Nginx configuration but it's not woking :

server { server_name example.com www.example.com; listen 80; listen [::]:80; return 301 https://www.example.com$request_uri; } server { listen 443 ssl; server_name example.com www.example.com; ssl_certificate /home/aspuser/ssl/example.crt; ssl_certificate_key /home/aspuser/ssl/example.key; access_log /var/log/nginx/reverse-access.log; error_log /var/log/nginx/reverse-error.log; location /ws { proxy_pass https://localhost:8443; } } 

I'm getting the error : HTTP ERROR 404, the page can’t be found.

I'm sure the underlying application is working because when in the config file, if I change the location to simply location / it works. However I need it for the pages with the suffix ws.

Can anyone help please ?

Thanks,