nginx - 80端口不能使用!

【字号: 日期:2022-10-24浏览:19作者:雯心

问题描述

1: 新一rails项目配置nginx如下:

server { listen 80; server_name gui; root /opt/dev/gui/public; # <--- be sure to point to ’public’! client_max_body_size 10M; passenger_enabled on; passenger_use_global_queue on; rails_env devlopment; access_log /opt/dev/gui/log/nginx.access.log ; error_log /opt/dev/gui/log/nginx.error.log ; # disable site via capistrano (cap deploy:web:disable) if (-f $document_root/system/maintenance.html) {rewrite ^(.*)$ /system/maintenance.html break; } error_page 500 502 503 504 /500.html; # expires headers, takes advantage of the Rails asset_tag helpers: location ~* ^.+.(ico)(?[0-9]+)?$ {passenger_enabled off;expires max; }}

2: nginx -s reload

3: 浏览器中输入:http://gui 怎么进不了我的应用呢

问题解答

回答1:

netstat -o查看占用80端口的PID,找到对应的服务,停止服务。我以前apache 80端口被占用是这样解决的。希望能帮到你

回答2:

你本地的host文件里面添加了gui指向127.0.0.1么

回答3:

先看看你80端口被占用没有

相关文章: