大战熟女丰满人妻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ù)文檔推薦 >>
主站蜘蛛池模板: 欧美娇小www| 国产爆操 | 噜噜嘿在线视频免费观看 | 免费一级毛片在级播放 | 久久国产精品夜色 | 亚洲视频免| 精品久久天干天天天按摩 | 国产国语一级a毛片高清视频 | 日韩免费不卡视频 | 国产伦精品一区二区三区无广告 | 亚洲一区二区精品 | 另类综合视频 | 99热这里只有精品首页精品 | 国产成人综合精品 | 成人美女黄网站色大色费 | 免费一级毛片在线播放欧美 | 欧美在线一级毛片观看 | 好吊妞视频一区二区 | 国产欧美一区二区精品久久久 | 亚洲第一区视频在线观看 | 四虎一影院区永久精品 | 亚洲国产天堂久久精品网 | 日本不卡视频 | 91精品视频在线免费观看 | jiucao在线观看精品 | 国产在线视频一区 | 欧美最猛的24k毛片视频 | 成人短视频在线观看 | 欧美日韩精品一区二区三区四区 | 欧美久久久久久久一区二区三区 | 亚洲依人| 黄色网址中文字幕 | 日本亚洲欧洲免费无码 | 欧美5o老妇性xxx | 91精品国产福利在线观看性色 | 日本精高清区一 | 精品综合久久久久久88小说 | 久草久草久草 | 激情综合五月亚洲婷婷 | 亚洲精品99久久久久中文字幕 | 国产在视频线在精品 |