nginx重启(nginx -s reload 不建议使用,本人亲试,有时候无效)

先 ps -ef | grep nginx ,会出现5个关于nginx的进程,如果5个进程的id分别为 100、101、102、103、104

杀掉所有nginx进程 kill -9 101 102 103 104

进入目录 cd /usr/sbin

重启 nginx -c /etc/nginx/nginx.conf

至于 nginx -s reload 不建议使用,本人亲试,有时候无效

启动nginx的时候也可以 cd /usr/sbin,然后直接 nginx , 
(-c 配置文件,表示根据指定文件启动,如果该配置文件和安装的nginx命令不是一个版本,会报错) 
启动后,nginx -t 可以查看是根据那个配置文件启动的,所以建议linux系统里只保留一个nginx.conf文件, 
以免出现冲突,一般nginx.conf在两个位置,分别是/usr/local/nginx/conf/nginx.conf和/etc/nginx/nginx.conf
--------------------- 
作者:一派从戎风度 
来源:CSDN 
原文:https://blog.csdn.net/qq_35337467/article/details/80307483 
版权声明:本文为博主原创文章,转载请附上博文链接!

发布了84 篇原创文章 · 获赞 84 · 访问量 25万+
展开阅读全文

nginx无法启动,报错各位大神看一下

07-07

nginx改了配置文件后启动不起来了 http { include mime.types; default_type application/octet-stream; #log_format main '$remote_addr - $remote_user [$time_local] "$request" ' # '$status $body_bytes_sent "$http_referer" ' # '"$http_user_agent" "$http_x_forwarded_for"'; #access_log logs/access.log main; sendfile on; #tcp_nopush on; #keepalive_timeout 0; keepalive_timeout 65; #gzip on; server { listen 443 ssl ; server_name www.1haoshopping.cn; ssl_certificate /home/Nginx/1_www.1haoshopping.cn_bundle.crt; ssl_certificate_key /home/Nginx/2_www.1haoshopping.cn.key; ssl_session_timeout 5000m; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_ciphers AESGCM:ALL:!DH:!EXPORT:!RC4:+HIGH:!MEDIUM:!LOW:!aNULL:!eNULL; ssl_prefer_server_ciphers on; add_header Strict-Transport-Security "max-age=63072000; includeSubdomains; preload"; add_header Content-Security-Policy upgrade-insecure-requests; if ( $scheme = http ) { rewrite ^/(.*) https://$server_name/ permanent; } #charset koi8-r; #access_log logs/host.access.log main; location / { proxy_pass http://120.77.232.4:8099/; proxy_set_header HOST $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } #error_page 404 /404.html; # redirect server error pages to the static page /50x.html # error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } # proxy the PHP scripts to Apache listening on 127.0.0.1:80 # #location ~ \.php$ { # proxy_pass http://127.0.0.1; #} # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 # #location ~ \.php$ { # root html; # fastcgi_pass 127.0.0.1:9000; # fastcgi_index index.php; # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; # include fastcgi_params; #} # deny access to .htaccess files, if Apache's document root # concurs with nginx's one # #location ~ /\.ht { # deny all; #} } # another virtual host using mix of IP-, name-, and port-based configuration # #server { # listen 8000; # listen somename:8080; # server_name somename alias another.alias; # location / { # root html; # index index.html index.htm; # } #} # HTTPS server # #server { # listen 443 ssl; # server_name localhost; # ssl_certificate cert.pem; # ssl_certificate_key cert.key; # ssl_session_cache shared:SSL:1m; # ssl_session_timeout 5m; # ssl_ciphers HIGH:!aNULL:!MD5; # ssl_prefer_server_ciphers on; # location / { # root html; # index index.html index.htm; # } #} } 问答

没有更多推荐了,返回首页

©️2019 CSDN 皮肤主题: 大白 设计师: CSDN官方博客

分享到微信朋友圈

×

扫一扫,手机浏览