【发布时间】:2020-06-20 14:52:28
【问题描述】:
我启动了 PM2,然后当我运行 nginx start 命令时。 PM 2 开始时没有问题,但是当我启动 NGINX 时。我总是遇到这个错误。
nginx[26370]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use) 这是我的配置文件
server {
listen 80 default_server;
listen [::]:80 ipv6only=on;
# SSL configuration
#
listen 443 ssl;
# listen [::]:443 ssl default_server;
#
# Note: You should disable gzip for SSL traffic.
# See: https://bugs.debian.org/773332
#
# Read up on ssl_ciphers to ensure a secure configuration.
# See: https://bugs.debian.org/765782
#
# Self signed certs generated by the ssl-cert package
# Don't use them in a production server!
#
# include snippets/snakeoil.conf;
#root /var/www/html;
root /root/my-website;
#app.js;
index index.html index.htm index.nginx-debian.html app.js;
server_name mywebsite.com;
ssl_certificate /root/folder/mywebsite.com.chained.crt;
ssl_certificate_key /root/folder/mywebsite.com.key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH';
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
proxy_pass http://localhost:80;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
# pass PHP scripts to FastCGI server
#
#location ~ \.php$ {
# include snippets/fastcgi-php.conf;
#
# # With php-fpm (or other unix sockets):
# fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
# # With php-cgi (or other tcp sockets):
# fastcgi_pass 127.0.0.1:9000;
#}
【问题讨论】:
标签: node.js express ubuntu nginx