Answer the question
In order to leave comments, you need to log in
Why is nginx not returning the html file?
For some reason, the example from the Internet does not work for me.
I use nginx to proxy local web services.
Now I just need to render a static html page.
I decided to implement it directly through NGINX, but in response 404.
Here is part of the config file:
server {
listen 443 ssl;
server_name myserver.com;
ssl_certificate /etc/...;
ssl_certificate_key /etc/...;
location / {
return 301 https://google.com;
}
location /privacy-policies/ { # так не работает
root /home/user/privacy_policys;
}
location / { # так тоже не работает
root /home/user/privacy_policys;
index index.html index.htm;
}
location /first_service/ {
proxy_pass http://localhost:3001;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
location /ssecond_service/ {
proxy_pass http://localhost:3002;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}
/home/user/privacy_policys
called it index.html
and policy.html
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question