nginx - 80端口不能使用!
大家讲道理
大家讲道理 2017-04-21 10:56:44
0
3
687

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 怎么进不了我的应用呢

大家讲道理
大家讲道理

光阴似箭催人老,日月如移越少年。

reply all(3)
阿神

netstat -oView the PID occupying port 80, find the corresponding service, and stop the service.
This is how I solved the problem of apache port 80 being occupied in the past.
Hope it helps you

大家讲道理

Have you added the gui pointing to 127.0.0.1 in your local host file

洪涛

First check if your port 80 is occupied

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template