monit rewrite
António P. P. Almeida
appa at perusio.net
Wed Sep 26 22:02:35 UTC 2012
On 26 Set 2012 23h56 CEST, appa at perusio.net wrote:
> On 26 Set 2012 21h00 CEST, aweber at comcast.net wrote:
>
>> OK, I am positive this is easy for you experienced nginx users!
>>
>> I have a backend app server setup and am using nginx for
>> caching/proxy/ssl-termination.
>>
>> I would like to use the "default" server (listening on 443) to
>> redirect the url https://host/monit to the server's monit-mini-http
>> server (and continue to use it for ssl termination). so I need to
>> direct the backend to http://localhost:2812/.
>
>
> Very basic. No rewrites.
>
> location ^~ /monit {
> location ~* ^/monit/(?<monit_request_uri>.*)$ {
> proxy_pass http://127.0.0.1:2812/$monit_request_uri;
> proxy_set_header Host $host;
> }
Err, make that:
location ^~ /monit {
location ~* ^/monit(?<monit_request_uri>.*)$ {
proxy_pass http://127.0.0.1:2812/$monit_request_uri;
proxy_set_header Host $host;
}
This way https://myserver/monit won't give a 404.
--- appa
> Feel free to add other headers to your liking.
>
> --- appa
>
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
More information about the nginx
mailing list