M
M
multiscripter2018-03-19 20:29:15
Nginx
multiscripter, 2018-03-19 20:29:15

Where does the script not found or unable to stat error appear in apache-error.log after enabling nginx?

Hello.
Raised on Windows Apache2.4 + mod_php.
Made a test site test.net
Its docroot D:/webservers/www/test/
Put index.php there with echo 'test'
Everything works fine.
Raised nginx in reverse proxy mode on port 80.
Apache moved to port 8080.
conf for test.net is this:
server {
listen 80;
server_name test.net www.test.net;
error_page 404 = @fallback;
charset utf-8;
root D:/webservers/www/test/;
error_log D:/webservers/logs/nginx/test.net.error.log;
index index.php index.htm index.html;
include proxy_params;
location / {
access_log D:/webservers/logs/nginx/test.net.access.log main;
try_files $uri $uri/ index.php;
}
location ~ \.php$ {
access_log D:/webservers/logs/nginx/test.net.access.log main;
proxy_pass http://127.0.0.1:8080;
}
location @proxy {
proxy_pass http://127.0.0.1:8080;
}
location @fallback {
proxy_pass http://127.0.0.1:8080;
}
}
When accessing the address: test.net,
the browser issues:
Not Found
The requested URL /index.php was not found on this server.
The following is written to the Apache error log:
[Mon Mar 19 20:23:06.789162 2018] [:error] [pid 9948:tid 1384] [client 127.0.0.1:54372] script 'D:/webservers/www/index.php' not found or unable to stat
That is, Apache looks for index.php in the root of the web server, not in the root of the site folder.
Sobsno CHADNT? Help me please. Thanks in advance.
proxy_params:
proxy_set_header Host $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;

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question