Score:0

nginx reverse proxy not serving local domain correctly

fr flag

I want to resolve a few domain names locally in my computer. To do this I added in /etc/hosts the following line:

127.0.0.1 example.com

Then I configured nginx with the following config file example.com.conf

server {
      server_name example.com;
      client_max_body_size 100M;

      ssl_certificate /home/user/certs/example.crt;
      ssl_certificate_key /home/user/certs/example.key;

      location / {
              proxy_pass https://127.0.0.1:3000;
      }

      listen 80;
}

When I got to example.com I still do not get the access that I need but if I put in example.com:3000 then it all works fine. Why isnt the port number not being correctly parsed in the proxy?

I am using Ubuntu 18.04 and nginx 1.14

djdomi avatar
za flag
are you sure that the site listen on port 3000 via https instead if http?
Mnemosyne avatar
fr flag
@djdomi yes, the connection has to be via https
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.