Quantcast
Channel: Nginx Forum
Viewing all articles
Browse latest Browse all 53287

proxy_pass to uri

$
0
0
I'm currently trying to setup the Gitit wiki engine with Nginx as a front end proxy. However, the proxy_pass directive is configured to work under the /docs URI of my domain. This has cause an issue, as all of the Gitit wiki links operate on the assuption that Gitit is installed at the root URI. I fixed this by recopiling nginx with the HttpSubModule and rewriting the links with the sub_filter directive. However, some functions of the wiki require the user to be logged in, and when one of those links are clicked, a redirect to /_login is issued, when I need it to go to /docs/_login. Is there some way to intercept and rewrite this redirect? Or does anyone have a better idea? My server configuration is included below.

server {
listen 80 default_server;
server_name mydomain.com;
access_log /srv/http/mydomain/access/nginx.acces.log;
error_log /srv/http/mydomain/error/nginx.error.log;

location / {
proxy_pass http://localhost:9000;
proxy_set_header Host $host;
}

location /docs/ {
proxy_pass http://localhost:5001/;
sub_filter href="/ href="/docs/;
sub_filter_once off;
}

Viewing all articles
Browse latest Browse all 53287


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>