标签:
以下为nginx.conf 的配置
user root root; worker_processes 1; events { worker_connections 1024; } http { include mime.types; default_type application/json; sendfile on; keepalive_timeout 65; log_format detail ‘$remote_addr - $args‘; upstream servers { server 10.128.21.41:6789; } server { listen 80; server_name localhost; location / { proxy_pass http://servers; } } server { listen 99; ssi_types *; ssi_silent_errors off; server_name localhost; auth_basic "Welcome to Kepler Admin!"; auth_basic_user_file /root/password/pwd; location / { ssi on; root /root/kepler/admin-console; } location /api { proxy_pass http://10.128.8.91:8080/kepler-collector-admin; } } }
通过以上配置后就可以通过localhost:99/XXX 来访问 /root/kepler/admin-console 下面的页面文件了。然后在页面文件中通过/api 来访问 http://10.128.8.91:8080/kepler-collector-admin 提供的资源。
标签:
原文地址:http://www.cnblogs.com/longzhaoyu/p/4895435.html