Answer the question
In order to leave comments, you need to log in
How to get rid of 404 error on yii and nginx site after page refresh?
There is a site sub1.site.com on yii on a webserver with nginx.
Frontend nginx config is like this
server {
listen 80;
listen 443 ssl;
set $host_path "/opt/www/fe.sub1.site.com/build";
access_log /var/log/nginx/sub1.access.log up_log;
error_log /var/log/nginx/sub1.ua.error.log;
server_name sub1.site.com;
root $host_path;
chunked_transfer_encoding off;
charset utf-8;
location /.well-known {
root /opt/www;
}
error_page 405 =200 $uri;
location / {
try_files $uri @back;
}
location @back {
proxy_pass http://127.0.0.1:8080$request_uri;
}
server {
listen 1280;
server_name fe.site.com;
location / {
return 301 https://$host$request_uri;
}
location /.well-known {
root /opt/www;
}
}
server {
listen 80;
listen 443 ssl;
set $host_path "/opt/www/fe.sub2.site.com/build";
access_log /var/log/nginx/sub2.access.log up_log;
error_log /var/log/nginx/sub2.ua.error.log;
server_name sub2.site.com;
root $host_path;
chunked_transfer_encoding off;
charset utf-8;
location /.well-known {
root /opt/www;
}
error_page 405 =200 $uri;
# location / {
# try_files $uri @back;
# }
# location @back {
# proxy_pass http://127.0.0.1:8080$request_uri;
# }
#server {
# listen 1280;
# server_name fe.site.com;
# location / {
# return 301 https://$host$request_uri;
# }
# location /.well-known {
# root /opt/www;
# }
#}
# location / {
# try_files $uri @back;
# }
# location @back {
# proxy_pass http://127.0.0.1:8080$request_uri;
# }
listen 1280;
? The site sub1.site.com does not work without it, but it is commented out in sub2. If 1280 on sub2 is uncommented, then nothing changes for it.
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