大战熟女丰满人妻av-荡女精品导航-岛国aaaa级午夜福利片-岛国av动作片在线观看-岛国av无码免费无禁网站-岛国大片激情做爰视频

專注Java教育14年 全國(guó)咨詢/投訴熱線:400-8080-105
動(dòng)力節(jié)點(diǎn)LOGO圖
始于2009,口口相傳的Java黃埔軍校
首頁(yè) hot資訊 部署多個(gè)Nginx服務(wù)

部署多個(gè)Nginx服務(wù)

更新時(shí)間:2021-12-17 11:53:26 來(lái)源:動(dòng)力節(jié)點(diǎn) 瀏覽2275次

眾所周知,Nginx (engine x) 是一個(gè)高性能的HTTP和反向代理服務(wù),也是一個(gè)IMAP/POP3/SMTP服務(wù)。

Nginx作為負(fù)載均衡服務(wù),Nginx 既可以在內(nèi)部直接支持 Rails 和 PHP 程序?qū)ν膺M(jìn)行服務(wù),也可以支持作為 HTTP代理服務(wù)對(duì)外進(jìn)行服務(wù)。

下載nginx

官方網(wǎng)址:http://nginx.org/en/download.html

下載之后解壓文件夾

文件目錄如下

conf是放配置文件的地方

html是存放頁(yè)面的文件夾,也可以用新建的文件夾,需要到conf里面去配置

在文件最上方輸入cmd,進(jìn)入文件根目錄

在命令行去啟動(dòng)nginx,下面是nginx的配置文件,比較簡(jiǎn)單,在conf里面找到nginx.conf文件,主要是修改這個(gè)配置文件,把你的項(xiàng)目放到nginx的根目錄里面去,在下面的文件去修改

#user  nobody;
worker_processes  1;
#error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;
#pid        logs/nginx.pid;
events {
    worker_connections  1024;
}
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 {//服務(wù),可以有多個(gè)server,對(duì)應(yīng)多個(gè)服務(wù)
        listen       8099;//端口
        server_name  localhost;//服務(wù)名
        #charset koi8-r;
        #access_log  logs/host.access.log  main;
        location / {//請(qǐng)求路徑
            root   xiamenviews;//根目錄下面的文件夾
            index  index.html index.htm;//文件夾下面的頁(yè)面
        }
		location =/index.html {
            root xiamenviews;//首頁(yè)文件夾
        }
        #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;
        #}
    }
    server {//第二個(gè)服務(wù),信息和第一個(gè)類型
        listen       8090;//端口
        server_name  localhost;
        #charset koi8-r;
        #access_log  logs/host.access.log  main;
        location / {
            root   views;
            index  index.html index.htm;
        }
		location =/index.html {
            root views;
        }
        #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;
    #    }
    #}
}

然后我們可以在頁(yè)面上訪問(wèn)那兩個(gè)端口,localhsot:8099,localhost8090,分別訪問(wèn)兩個(gè)頁(yè)面,大致就是這樣了。如果大家對(duì)此比較感興趣,想了解更多相關(guān)知識(shí),不妨來(lái)關(guān)注一下動(dòng)力節(jié)點(diǎn)的Java在線學(xué)習(xí),里面的課程內(nèi)容豐富,通俗易懂,適合小白學(xué)習(xí),希望對(duì)大家能夠有所幫助。

提交申請(qǐng)后,顧問(wèn)老師會(huì)電話與您溝通安排學(xué)習(xí)

免費(fèi)課程推薦 >>
技術(shù)文檔推薦 >>
主站蜘蛛池模板: 手机看片国产永久1204 | 欧洲成人全免费视频网站 | 国产真实偷人视频在线播放 | 毛片毛片毛片毛片出来毛片 | 久久综合给合久久97色美利坚 | 亚洲欧美日韩在线观看二区 | 最新国产中文字幕 | 精品一区二区日本高清 | 国产精品久久久久孕妇 | 东京干手机福利视频 | 亚洲国产精品a一区二区三区 | 美美女高清毛片视频黄的一免费 | 激情都市久久爱 | 日韩精品特黄毛片免费看 | 欧美人与动性xxxxbbbb | 久久久高清日本道免费观看 | 玖玖精品视频在线 | 日日摸日日 | 久久青青草视频 | 真人实干一级毛片aa免费 | 日韩精品亚洲人成在线播放 | 国产高清狼人香蕉在线观看 | 国产不卡在线观看视频 | 免费精品一区二区三区在线观看 | 日韩新片王 | 我想看一级毛片免费的 | 久久6精品 | 国产精品在线播放 | 欧美伊人久久久久久久久影院 | 男人的天堂在线精品视频 | 欧美另类黑人巨大videos | 婷婷在线观看网站 | 国产福利视频 | 国产不卡精品一区二区三区 | 日本一级毛片无遮挡 | 欧美激情精品久久久久久不卡 | 男人的天堂免费在线观看 | 一级毛片免费观看不卡的 | 精品乱人伦一区二区 | 欧美一级久久久久久久大 | 999视频在线播放777 |