Welcome! Log In Create A New Profile

Advanced

proxy_pass to uri

Posted by ub1quit33 
proxy_pass to uri
January 11, 2013 05:16PM
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;
}
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 141
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready