我有一个使用独角兽在 nginx 服务器后面的服务上运行的应用程序。
如果我访问http://server.com我得到了应用程序,启动并运行......但我仍然可以访问端口 8080 上的应用程序,如http://server.com:8080但这一次,没有资产(这是由 nginx 服务)
如何阻止直接访问我的产品上的端口 8080。服务器?
服务器是 Ubuntu 12.04
nginx.conf
upstream unicorn {
server 127.0.0.1:8080;
}
server {
listen 80 default deferred;
# server_name example.com;
root /home/deploy/current/public;
location ^~ /assets/ {
gzip_static on;
expires max;
add_header Cache-Control public;
}
try_files $uri/index.html $uri @unicorn;
location @unicorn {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://unicorn;
}
error_page 500 502 503 504 /500.html;
client_max_body_size 4G;
keepalive_timeout 10;
}