黄色网址大全免费-黄色网址你懂得-黄色网址你懂的-黄色网址有那些-免费超爽视频-免费大片黄国产在线观看

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

部署多個Nginx服務

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

眾所周知,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在線學習,里面的課程內容豐富,通俗易懂,適合小白學習,希望對大家能夠有所幫助。

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

免費課程推薦 >>
技術文檔推薦 >>
主站蜘蛛池模板: 中国黄色毛片视频 | 床上毛片 | 特黄特黄aaaa级毛片免费看 | 永久免费在线视频 | 久久影院秋霞理论 | 97精品视频在线 | 欧美.亚洲.日本一区二区三区 | 欧美成人免费做真爱大片 | 亚洲男女免费视频 | 欧美ay亚洲ay日韩ay | 羞羞在线 | 欧美网站在线看 | 日本黄色一级片视频 | 久艹在线视频 | 午夜在线播放免费人成无 | 欧美成人性色xxxx视频 | 色香蕉在线观看网站 | aⅴ免费视频 | 天天摸天天舔 | 精品女同一区二区三区免费播放 | 天天操国产 | 亚洲成人国产 | 欧美在线欧美 | 国产成人精品视频午夜 | 91在线一区二区三区 | 日韩精品 欧美 | 日日a.v拍夜夜添久久免费 | 日韩在线播放视频 | 免费在线观看的黄色网址 | 国产三级a三级三级三级 | 免费国产成人高清在线观看视频 | 日韩在线aⅴ免费视频 | 最色视频| 亚洲女人国产香蕉久久精品 | 国产日韩欧美不卡www | 我色综合 | 久久免费视频一区 | 色在线观看视频 | 性美国xxxxx 性另类交性类交 | 国产制服丝袜在线观看 | 亚洲视频在线免费播放 |