如何將項目放到nginx


65上面nginx:

cd etc/nginx/conf/vhosts/ 

 

、在服務器根目錄下

如何將項目放到nginx
2、打開vhosts文件

如何將項目放到nginx
3、列出此文件夾下的內容

如何將項目放到nginx
4、將其中的一個文件復制一份,重命名為自己要上傳的項目名稱

例:將www.shixuantai.com.conf復制,並重命名為www.pinhong.com.conf

命令:cp www.shixuantai.com.conf www.pinhong.com.conf

5、打開www.pinhong.com.conf

如何將項目放到nginx
6、修改兩個紅圈地方為要上傳的項目名

如何將項目放到nginx
7、然后重啟nginx

如何將項目放到nginx
若找不到nginx,可執行下面操作

如何將項目放到nginx

 

 

--------------------------------------------------

1,

cd etc/nginx/conf/vhists

 

2. cp wei.conf  rec.conf

 

3 重啟nginx

service nginx reload

 

 

======================================================

二.創建文件夾

mkdir MySQL

 

server {
        listen 443; server_name www.layib.com layib.com;
        ssl on;
        root /alidata/www/layiba/;
        index index.html index.htm index.php;
        ssl_certificate /alidata/server/nginx/sslkey/214336815030324.pem;
        ssl_certificate_key  /alidata/server/nginx/sslkey/214336815030324.key;
        ssl_session_timeout 5m;
        ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
        ssl_ciphers AESGCM:ALL:!DH:!EXPORT:!RC4:+HIGH:!MEDIUM:!LOW:!aNULL:!eNULL;
        ssl_prefer_server_ciphers on;
         error_page 404 http://www.layib.com/themes/404.html;
        location ~ .*\.(php|php5)?$
        {
                #fastcgi_pass  unix:/tmp/php-cgi.sock;
                fastcgi_pass  127.0.0.1:9000;
                fastcgi_index index.php;
                include fastcgi.conf;
        }
        location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
        {
                expires 30d;
        }
        location ~ .*\.(js|css)?$
        {
                expires 1h;
        }
        #α¾²Ì¬¹æÔò
        include /alidata/server/nginx/conf/rewrite/default.conf;
        access_log  /alidata/log/nginx/access/default.log;
}

  

server {
        listen  443;
        server_name mrecycle.layib.com;
        ssl on;
        root html;
        index index.html index.htm;
        ssl_certificate   /alidata/server/nginx/sslkey/214473678800324.key;
        ssl_certificate_key /alidata/server/nginx/sslkey/214473678800324.key;
        ssl_session_timeout 5m;
        ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
        ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
        ssl_prefer_server_ciphers on;
        access_log   /alidata/log/nginx/access/huishouq.log;
        location / {    
                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_pass http://101.200.156.65:8180;  
        }       
        
}

 

阿里雲解析:

 

 

 

 

nginx 配置 端口 訪問靜態地址

server {
    listen 80;
    server_name wechatbaoan.layib.com;
    root /alidata/www/wechatbaoan/dist;
    location / {
         try_files $uri $uri/ @router;
    index  index.html index.htm;
    }
    location @router {
       rewrite ^.*$ /index.html last;
    }
    #access_log /home/wssgcg1213/NB/nginx.access.log;
    #error_log /home/wssgcg1213/NB/nginx.error.log;

    index index.html index.php;
    autoindex off;

    location ~* .*\.(gif|jpg|jpeg|png|bmp|ico|css|js|txt|flv|swf|mid|doc|ppt|xls|pdf|txt|mp3|wma)$ {
            expires 2d;
    }

}

 



 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM