Hi all,
We are using nginx-0.6.35 and we have a kludge of a set for one of our apps because it is only installed on one server in a pair. So we have an odd setup for it:
[code]
server {
listen 80;
server_name dns.app1.com;
rewrite ^(.*)$ http://dns.app1.com:8888$1 permanent;
}
[/code]
Both servers have this configuration and it works. But now i want to introduce basic auth for the app, but i can not seem to get this to work:
[code]
server {
listen 80;
server_name app-on-server-1.company.com;
rewrite ^(.*)$ http://app-on-server-1.company.com:8888$1 permanent;
location / {
auth_basic "Restricted";
auth_basic_user_file passfile
}
}
[/code]
I read in another post that auth and rewrite can't be setup like this. so now I am a bit stumped at how i would set this up. granted my knowledge in this area is thin.
Ideally i would like to set something like this up where we don't deal with the permanent :8888 port on the url, but this doesn't seem to work. where both servers have this:
[code]
server {
listen 80;
server_name dns.app1.com;
location / {
auth_basic "Restricted";
auth_basic_user_file passfile;
include /etc/nginx/common/proxy.conf;
proxy_pass http://10.4.5.6:8888;
break;
}
}
[/code]
Any help
Thanks
Zach