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

專注Java教育14年 全國咨詢/投訴熱線:400-8080-105
動力節點LOGO圖
始于2009,口口相傳的Java黃埔軍校
首頁 hot資訊 部署多個Nginx服務

部署多個Nginx服務

更新時間:2021-12-17 11:53:26 來源:動力節點 瀏覽2161次

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

Nginx作為負載均衡服務,Nginx 既可以在內部直接支持 Rails 和 PHP 程序對外進行服務,也可以支持作為 HTTP代理服務對外進行服務。

下載nginx

官方網址:http://nginx.org/en/download.html

下載之后解壓文件夾

文件目錄如下

conf是放配置文件的地方

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

在文件最上方輸入cmd,進入文件根目錄

在命令行去啟動nginx,下面是nginx的配置文件,比較簡單,在conf里面找到nginx.conf文件,主要是修改這個配置文件,把你的項目放到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 {//服務,可以有多個server,對應多個服務
        listen       8099;//端口
        server_name  localhost;//服務名
        #charset koi8-r;
        #access_log  logs/host.access.log  main;
        location / {//請求路徑
            root   xiamenviews;//根目錄下面的文件夾
            index  index.html index.htm;//文件夾下面的頁面
        }
		location =/index.html {
            root xiamenviews;//首頁文件夾
        }
        #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 {//第二個服務,信息和第一個類型
        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;
    #    }
    #}
}

然后我們可以在頁面上訪問那兩個端口,localhsot:8099,localhost8090,分別訪問兩個頁面,大致就是這樣了。如果大家對此比較感興趣,想了解更多相關知識,不妨來關注一下動力節點的Java在線學習,里面的課程內容豐富,通俗易懂,適合小白學習,希望對大家能夠有所幫助。

提交申請后,顧問老師會電話與您溝通安排學習

免費課程推薦 >>
技術文檔推薦 >>
主站蜘蛛池模板: 久久爱www成人 | 美女在线看永久免费网址 | 亚洲干综合 | 99久在线观看 | 欧美激情一区二区三区视频 | 国产一区二区三区在线视频 | 特级毛片在线大全免费播放 | 日日碰狠狠添天天爽对白 | 日韩大片在线 | 欧美另类亚洲一区二区 | 久久久久久久国产精品影院 | 欧美一区二区三区在线视频 | 欧美日韩在线网站 | 综合久久久久久中文字幕 | 不卡福利视频 | 色综合一区 | 免费在线黄色网址 | 色综合久久久久久久久五月 | 亚洲欧洲第一页 | 天天看夜夜操 | 香蕉视频精品 | 2018一级毛片免费观看 | 久久国产美女免费观看精品 | 日日骚 | 国产成人亚洲精品一区二区在线看 | 高清不卡毛片免费观看 | 欧美啪啪毛片一区二区 | 亚洲性事 | 国内在线视频 | 久久这里只有精品国产 | 久久九九青青国产精品 | 国产乱人视频在线播放不卡 | 国产国产人免费观看在线视频 | 91精品国产91久久久久久 | 欧美激情伦妇在线观看 | 中国女人精69xxx| 久久中文字幕网 | 亚欧毛片 | 亚洲精品一区二区在线播放 | 99视频在线播放 | 一a一级片 |