nginx更改映射ip、端口

1、找到并编辑配置文件

[html]  view plain  copy
  在CODE上查看代码片 派生到我的代码片
  1. vi  /usr/local/nginx/conf/nginx.conf  

*按i进入编辑模式,改完之后,按Esc ->shift+: wq 


2、10.73.9.47:8080修改成本机的ip和端口。

[html]  view plain  copy
  在CODE上查看代码片 派生到我的代码片
    1. server {  
    2.         listen       8080;  
    3.         server_name  localhost;  
    4.   
    5.         #charset koi8-r;  
    6.   
    7.         #access_log  logs/host.access.log  main;  
    8.   
这里8080改成指定端口,localhost改成服务器IP

3、nginx重新加载配置文件 

[html]  view plain  copy
  在CODE上查看代码片 派生到我的代码片
  1. /usr/local/nginx/sbin/nginx -s reload  

猜你喜欢

转载自blog.csdn.net/qq_30346089/article/details/67640564