I want to make a simple reverse proxy:
http://outer-ip/gitlab
-> http://192.168.1.10:9000
And that's ok, but when I reach my site, I have got tons of 404
in my Mozilla log. Probably te reason is not adding port to request:
GET /assets/webpack/pages.root.ec399de0.chunk.js HTTP/1.1
Host: 192.168.1.10
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:93.0) Gecko/20100101 Firefox/93.0
Accept: */*
Accept-Language: pl,en-US;q=0.7,en;q=0.3
Accept-Encoding: gzip, deflate
Referer: http://192.168.1.10/gitlab/
Connection: keep-alive
Cookie: ...
Cache-Control: max-age=0
my nginx routing configuration:
worker_processes 1;
events { worker_connections 1024; }
http {
server {
listen 80;
port_in_redirect off;
location /gitlab/ {
proxy_pass http://192.168.1.10:9980/;
proxy_set_header Host 192.168.1.10:9980;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $server_name;
}
}
}