Answer the question
In order to leave comments, you need to log in
nginx -> nginx + fastcgi extra port substitution
Good day!
At home, I set up a server and an incomprehensible thing happens.
The Internet is connected through a router. From the router, from port 80, the request is sent to the computer, which acts as a repository and part-time http proxy (nginx).
There is also a working machine, it has nginx + fastcgi
The problem is this:
php, apparently, when it takes server host, it gets not just a domain, but also an extra port, as a result it turns out like this sub.domain.zone:8080/catalog
Therefore none of the links open. Tell me how can I remove this port?
A piece of the config on the proxy server:
server {
listen 80;
server_name sub.domain.zone www.sub.domain.zone;
location / {
proxy_pass 192.168.1.1 :8080;
proxy_redirect sub.domain.zone :8080 sub.domain.zone; #I already substituted this when looking for a solution, proxy_set_header does not help
Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-for $remote_addr;
}
}
server {
listen 192.168.1.1:8080;
server_name sub.domain.zone www.sub.domain.zone;
access_log G:/var/www/domain/data/logs/sub.domain.zone.access_log;
error_log G:/var/www/domain/data/logs/sub.domain.zone.error_log;
root G:/var/www/domain/data/www/sub.domain.zone;
index index.php;
location / {
root G:/var/www/domain/data/www/sub.domain.zone;
if (!-e $request_filename) {
rewrite ^/(.*)$ /index.php?q=$1 last;
}
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(.*)$;
fastcgi_pass 127.0.0.1:9123;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_ignore_client_abort on;
include fastcgi_params;
#include fastcgi.conf;
fastcgi_param SERVER_NAME $http_host;
}
location ~ /\.ht {
deny all;
}
autoindex off;
}
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