Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pm2 start成功没反应 #85

Open
geekape opened this issue Jul 20, 2020 · 1 comment
Open

pm2 start成功没反应 #85

geekape opened this issue Jul 20, 2020 · 1 comment

Comments

@geekape
Copy link

geekape commented Jul 20, 2020

本地yarn build后上传.nuxt,static,nuxt.config,package到服务器。

服务器上安装好包后,pm2 start --name blog npm -- start成功了。

image

我的Nginx配置,和相同一个nuxt项目一样配置的:

map $sent_http_content_type $expires {
    "text/html"                 epoch;
    "text/html; charset=utf-8"  epoch;
    default                     off;
}

server {
    listen          80;             # the port nginx is listening on
    server_name     zcbing.cn;    # setup your domain here
	root /www/wwwroot/zcbing.cn;
    
    gzip            on;
    gzip_types      text/plain application/xml text/css application/javascript;
    gzip_min_length 1000;
    
    location / {

        expires $expires;

        proxy_redirect                      off;
        proxy_set_header Host               $host;
        proxy_set_header X-Real-IP          $remote_addr;
        proxy_set_header X-Forwarded-For    $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto  $scheme;
        proxy_read_timeout          1m;
        proxy_connect_timeout       1m;
        proxy_pass                          http://176.122.147.140:9000; # set the address of the Node.js instance here
    }
    
    
}

想问下我是哪里配置有问题呢?

@eshengsky
Copy link
Owner

没反应具体指的什么?
试试在服务器上绕过Nginx直接访问 http://127.0.0.1:9000,如果不成功,说明 iBlog 启动失败,执行 pm2 logs 查看报错日志;
如果能成功访问,则说明是 Nginx 配置有误,排查 conf 文件。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants