port - Nginx M/Monit password protect -


i trying protect access m/monit web interface:
box:
ubuntu 14.04
nginx 1.8.1
mmonit-3.5.1

i created mmonit config file under /etc/nginx/sites-available:

server {         listen 8080;         root /var/www/html;         location / {                 auth_basic "restricted content";                 auth_basic_user_file /etc/nginx/.htpasswd;         }          location ~ /\.ht {                 deny all;         }  } 

it not display authentication dialog. followed serverfault-nginx password protect entire port number 8081, seems getting done wrong...i new nginx.

anyone has idea how go it? should in same default server config file? cheers

so figured out...
(this under default server config)

root /var/www/html/; server_name localhost;  location /mmonit/ {     proxy_pass http://yourserverip:8080/;     auth_basic "restricted content";     auth_basic_user_file /path/to/your/password/file/;     index index.csp; } 

ln -s /path/to/your/mmonit/folder/ /var/www/html/
gives: mmonit -> /path/to/your/mmonit/folder/

now point browser at: http://yourserverip/mmonit/
, have 'authentication required' dialog box!
a username , password being requested http://yourserverip. site says: "restricted content"

**i suggest calling link else mmonit....to choice.
wayz access double protected!


Comments

Popular posts from this blog

routing - AngularJS State management ->load multiple states in one page -

python - GRASS parser() error -

json - Gson().fromJson(jsonResult, Myobject.class) return values in 0's -