Nginx Configuration Multi-domain Spring boot project (multiple ports on same server)

Source: Internet
Author: User

2017-02-20

1#user nobody;2Worker_processes 1;3 4#error_log Logs/error.log;5#error_log Logs/error.log Notice;6#error_log Logs/error.log Info;7 8#pid Logs/nginx.pid;9 Ten  One Events { AWorker_connections 1024; - } -  the  - 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 '' A# ' "$http _user_agent" "$http _x_forwarded_for" '; at  -#access_log Logs/access.log Main; -  -Sendfile on; -#tcp_nopush on; -  in#keepalive_timeout 0; -Keepalive_timeout 65; to  +#gzip on; -# the# * server { $server_name vrspring.com;Panax NotoginsengListen 80; -Access_logoff; theIndex index.html index.htm index.jsp; +  ALocation/ {  theClient_max_body_size 100m; +Client_body_buffer_size 128k; -Proxy_send_timeout 300; $Proxy_read_timeout 300; $Proxy_buffer_size 4k; -Proxy_buffers 32k; -Proxy_busy_buffers_size 64k; theProxy_temp_file_write_size 64k; -Proxy_connect_timeout 30s;WuyiProxy_pass http://localhost:8089; theProxy_set_header Host $host; -Proxy_set_header X-real-ip $remote _addr; WuProxy_set_header x-forwarded- for$proxy _add_x_forwarded_for; - }  About } $  - server { -server_name m.vrspring.com; -Listen 80; AAccess_logoff; +Index index.html index.htm index.jsp; the  -Location/ {  $Client_max_body_size 100m; theClient_body_buffer_size 128k; theProxy_send_timeout 300; theProxy_read_timeout 300; theProxy_buffer_size 4k; -Proxy_buffers 32k; inProxy_busy_buffers_size 64k; theProxy_temp_file_write_size 64k; theProxy_connect_timeout 30s; AboutProxy_pass http://localhost:8090; theProxy_set_header Host $host; theProxy_set_header X-real-ip $remote _addr; theProxy_set_header x-forwarded- for$proxy _add_x_forwarded_for; + }  - } the Bayi  the#server { the# Listen 80; -# server_name localhost; -  the#charset Koi8-r; the  the#access_log Logs/host.access.log Main; the  -# location/ { the# root HTML; the# index index.html index.htm; the# }94  the#error_page 404/404.html; the  the# REDIRECT Server error pages to the static page/50x.HTML98# About# Error_page 502 503 504/50x.html; -# location =/50x.HTML {101# root HTML;102# }103 104# Proxy The PHP scripts to Apache listening on127.0.0.1:80 the#106#location ~ \.php$ {107# Proxy_pass http://127.0.0.1;108#}109  the# Pass the PHP scripts to FastCGI server listening on127.0.0.1:9000111# the#location ~ \.php$ {113# root HTML; the# Fastcgi_pass 127.0.0.1:9000; the# Fastcgi_index index.php; the# Fastcgi_param Script_filename/scripts$fastcgi_script_name;117# include Fastcgi_params;118#}119  -# Deny access to. htaccessFiles,ifApache ' s document Root121#concurs with Nginx ' s one122#123#location ~/\.HT {124# Deny All; the#}126# }127  - 129# Another virtual host using mix of ip-, name-,and port-based configuration the#131#server { the# Listen 8000;133# Listen somename:8080;134# server_name somename alias Another.alias;135 136# location/ {137# root HTML;138# index index.html index.htm;139# } $#}141 142 143#HTTPS Server144#145#server {146# Listen 443 SSL;147# server_name localhost;148 149# ssl_certificate Cert.pem; Max# Ssl_certificate_key Cert.key;151  the# Ssl_session_cache Shared: SSL: 1m;153# ssl_session_timeout 5m;154 155# ssl_ciphers high:!anull:! MD5;156# ssl_prefer_server_ciphers on;157 158# location/ {159# root HTML; the# index index.html index.htm;161# }162#}163 164}

Nginx Configuration Multi-domain Spring boot project (multiple ports on same server)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.