1

I have a server that is running at 127.0.0.1:8323

This port is not reachable from outside.

I want to provide this ip address as https://example.com/website/index.php over the port 80

How can i do this using nginx?

I have tried using proxy_pass in a server, like :

server {
listen 80;
location website/ {
proxy_pass https://127.0.0.1:8323;
 }
}

But it returns 404

1 Answer 1

1
  • If you want to provide the site with TLS it should be on port 443, not 80 (see RFC 9110, 4.2.2).
  • The service on localhost:8323 might not have TLS; in this case you should not try to access it with https://.
  • The location defined as a prefix string should start with a /.

Minimum TLS configuration would be:

server {
    listen              443 ssl;
    server_name         example.com;
    ssl_certificate     /path/to/example.com.crt;
    ssl_certificate_key /path/to/example.com.key;

    location /website/ {
        proxy_pass http://127.0.0.1:8323;
    }
}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .