linux under a cloud nginx server configuration and file upload package

1.shell6 for linux host for remote management - server connection

Xshell under Windows is a very powerful secure terminal emulation software that supports Telnet, Rlogin, SSH, SFTP, Serial and other agreements.

2. Installation nginx, method of installation reference ( https://blog.csdn.net/javandroid/article/details/81177449 ). (Recommended install yum source)

3. Use xftp file to package uploaded to the server / home / root / html-5000, folder address can be customized.

Which html-5000 files in that folder is a file after I react packaged items.

            

 

 

4. After installation into the usr local nginx / conf / / /, for nginx.conf configuration file. Specific steps are as follows:

       

        First, create the / usr / local / nginx under / conf directory new folder vhost, as their own profile directory, and then enter a new vhost configuration file, such as html-5000.conf.

    

       Specific configuration is as follows:

{Server 
    the listen 5000; 
    server_name 0.0.0.0; 

    the root / Home / the root / HTML-5000; // here after standing package uploaded to the content server. 
    index.html index.htm index; 

    LOCATION / { 
        try_files $ $ URI URI / /index.html; 
    } 

    LOCATION ^ ~ / Assets / { 
        gzip_static ON; 
        Expires max; 
        the add_header the Cache-Control public; 
    } 

    error_page 500 502 503 504/500 .html; 
    client_max_body_size 20M; 
    keepalive_timeout 10; 
}

  Then, introduced in nginx.conf file in the above configuration file (ie, the following picture of crossed statement), use vi nginx.conf command to enter nginx.conf file and edit it and other operations.

         

      ps: linux under the vi command file

按ESC键 跳到命令模式,然后:

:w   保存文件但不退出vi
:w file 将修改另外保存到file中,不退出vi
:w!   强制保存,不推出vi
:wq  保存文件并退出vi
:wq! 强制保存文件,并退出vi
q:  不保存文件,退出vi
:q! 不保存文件,强制退出vi
:e! 放弃所有修改,从上次保存文件开始再编辑

5.启动nginx

    启动 Nginx 代码格式:nginx安装目录地址  ,因为我已经进入了/usr/local/nginx/sbin目录,

     所以我的nginx启动命令为:./ngnix

     重新加载配置文件:./nginx -s reload

停止:

 

./nginx -s quit

 

./nginx -s stop

 

 

Guess you like

Origin www.cnblogs.com/celine-huang/p/10930549.html