0
I have a server vhost Nginx called site-responsive.test follows below the configuration
server {
listen 80;
server_name site-responsivo.test;
root /home/rafaelejosi/www/projetos/site-responsivo.test/;
index index.html index.htm index.php;
charset utf-8;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
#Este fuciona no link http://site-responsivo.test/wordpress/
location /wordpress {
index index.php index.html index.htm index.nginx-debian.html;
try_files $uri $uri/ /index.php?$query_string;
}
#O site original esta quebrado com erro no nginx 403 Forbidden http://site-responsivo.test/
location /php {
index index.php index.html index.htm index.nginx-debian.html;
try_files $uri $uri/ /index.php?$query_string;
}
location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
access_log on;
error_log /var/log/nginx/site-responsivo.test-error.log error ;
rewrite_log on;
error_page 404 /index.php;
sendfile off;
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_intercept_errors off;
fastcgi_buffer_size 16k;
fastcgi_buffers 4 16k;
}
location ~ /\.ht {
deny all;
}
}
knowing that the directory structure is this
what is the right way to set up this vhost for the two to work?
Is making a mistake in
http://site-responsivo.test/
orhttp://site-responsivo.test/php
? If it is the first: there is some file of index in the briefcasesite-responsivo.test
?– Valdeir Psr
@Valdeirpsr nessa http://site-responsivo.test/ but now I realized the error everything was moved to this http://site-responsivo.test/php and this working ta normal kkk, but I didn’t even connect
– Rafael Dias Zendron
@Valdeirpsr but taking the opportunity the pages in http://site-responsivo.test/php work normal, http://site-responsivo.test/wordpress, where I have the same menu not linking to the other pages of file not found, vo see if I can publish the site on any server have any suggestions host-free that to move up wordpress and the version that is in php?
– Rafael Dias Zendron
@By the way, Valdeirpsr has to program a redirect for when typing http://site-responsivo.test go automatically to http://site-responsivo.test/php ignoring 404 even at the local installation?
– Rafael Dias Zendron
As you duplicated the site, you may need to check the settings in the database.
– Valdeir Psr
And to right the wrong
404
(inhttp://site-responsivo.test/
), you can userewrite
ortry_files /php/index.php?$args
– Valdeir Psr