My problem seem to be simple …
I have 1 server on my lan 192.168.0.2 with a root path /var/www/ (apache2)
and 1 domain example.com (nginx)
and 1 subdomain bug.example.com (nginx)
and want only a proxy beetween
http://192.168.0.2/bugs/ --->> http://bug.example.com/
I use a bugtracker (Mantis) in the root directory like this /var/www/bugs
this config work :
server {
listen 80;
server_name bug.example.com;
location / {
proxy_pass http://192.168.0.2/bugs/;
}
}
But i don’t have access to css or images …
Css :
<link rel="stylesheet" type="text/css" href="http://192.168.0.2/bugs/css/default.css" />
image :
<link rel="shortcut icon" href="/bugs/images/favicon.ico" type="image/x-icon" />
I have test a LOT OF configuration with “proxy_set_header” , “proxy_redirect” , “rewrite” … but never with success 🙁
Can anybody help me ?
This is a PHP problem. The site doesn’t know for the redirect… As I see, it renders the CSS files with full path 192.168.0.2/bugs…
Try to find a solution how to handle this in PHP, not nginx.
Look for a configuration setting for HOST_NAME or similar in Mantis.
As for images, changing to bugs.site.com/bugs should fix them.. Otherwise you’ll need to let Mantis know that it has no virtual path /bugs. Is it an Apache server behind?
UPDATE: Actually you could try stripping HOST header and sending it modified as ‘bugs.site.com’… It all depends on the actuall web server/Mantis/ configuration ..