Answer the question
In order to leave comments, you need to log in
How to set default page in nginx?
How to make it so that when you enter site.ru, the login.html page automatically opens?
Config:
server {
listen 443 ssl;
server_name site.ru;
include acme;
location / {
proxy_pass http://localhost:5000;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_read_timeout 900;
client_max_body_size 2000M;
}
ssl_certificate /etc/nginx/ssl/site.ru.crt;
ssl_certificate_key /etc/nginx/ssl/site.ru.key;
ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers "RC4:HIGH:!aNULL:!MD5:!kEDH";
add_header Strict-Transport-Security 'max-age=600';
}
server {
listen 80;
server_name site.ru;
rewrite ^ https://site.ru$request_uri? permanent;
}
index login.html;
try_files $uri $uri/login.html;
*1 rewrite or internal redirection cycle while internally redirecting to "//login.html/login.html/login.html/login.html/login.htm
l/login.html/login.html/login.html/login.html/login.html/login.html"
Answer the question
In order to leave comments, you need to log in
Just add rewrite to the desired address.
location / {
rewrite ^/$ /login.html;
proxy_pass http://localhost:5000;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question