-
Notifications
You must be signed in to change notification settings - Fork 534
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
422 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
worker_processes 1; | ||
|
||
error_log logs/error.log; | ||
|
||
pid logs/nginx.pid; | ||
|
||
events { | ||
worker_connections 1024; | ||
} | ||
|
||
http { | ||
include mime.types; | ||
default_type application/octet-stream; | ||
|
||
sendfile on; | ||
|
||
keepalive_timeout 65; | ||
|
||
upstream lb { | ||
server 127.0.0.1:8001; | ||
server 127.0.0.1:8002; | ||
} | ||
|
||
server { | ||
listen 80; | ||
server_name localhost; | ||
|
||
# 响应头中添加请求转向那台服务的ip和状态码 | ||
add_header backendIP $upstream_addr; | ||
add_header backendCode $upstream_status; | ||
|
||
location / { | ||
#反向代理到自己的upstream, 里面的多个server实现负载均衡 | ||
proxy_pass http://lb; | ||
proxy_set_header Host $host; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header REMOTE-HOST $remote_addr; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,151 @@ | ||
#user nobody; | ||
worker_processes 1; | ||
|
||
error_log logs/error.log; | ||
|
||
events { | ||
worker_connections 1024; | ||
} | ||
|
||
|
||
http { | ||
include mime.types; | ||
default_type application/octet-stream; | ||
|
||
sendfile on; | ||
|
||
keepalive_timeout 65; | ||
|
||
#gzip on; | ||
|
||
server { | ||
listen 8001; | ||
server_name eleteam.com www.eleteam.com; | ||
|
||
location / { | ||
root html/Shop-PHP-Yii2/frontend/web; | ||
fastcgi_pass 127.0.0.1:9001; | ||
fastcgi_index index.php; | ||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | ||
include fastcgi_params; | ||
if (!-e $request_filename){ | ||
rewrite ^/(.*) /index.php last; | ||
} | ||
} | ||
|
||
location ~ /(css|js|f7|image|assets) { | ||
root html/Shop-PHP-Yii2/frontend/web; | ||
} | ||
} | ||
|
||
server { | ||
listen 8001; | ||
server_name m.eleteam.com; | ||
|
||
location / { | ||
root html/Shop-PHP-Yii2/wap/web; | ||
fastcgi_pass 127.0.0.1:9001; | ||
fastcgi_index index.php; | ||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | ||
include fastcgi_params; | ||
if (!-e $request_filename){ | ||
rewrite ^/(.*) /index.php last; | ||
} | ||
} | ||
|
||
location ~ /(css|js|f7|image|assets) { | ||
root html/Shop-PHP-Yii2/wap/web; | ||
} | ||
} | ||
|
||
server { | ||
listen 8001; | ||
server_name admin.eleteam.com; | ||
|
||
location / { | ||
root html/Shop-PHP-Yii2/backend/web; | ||
fastcgi_pass 127.0.0.1:9001; | ||
fastcgi_index index.php; | ||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | ||
include fastcgi_params; | ||
if (!-f $request_filename){ | ||
rewrite (.*) /index.php; | ||
} | ||
} | ||
|
||
location ~ /(css|js|f7|image|adminlte|assets|fonts|huiadmin|upload) { | ||
root html/Shop-PHP-Yii2/backend/web; | ||
} | ||
} | ||
|
||
server { | ||
listen 8001; | ||
server_name api.eleteam.com; | ||
|
||
location / { | ||
root html/Shop-PHP-Yii2/api/web; | ||
fastcgi_pass 127.0.0.1:9001; | ||
fastcgi_index index.php; | ||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | ||
include fastcgi_params; | ||
} | ||
} | ||
|
||
server { | ||
listen 8001; | ||
server_name data.eleteam.com; | ||
|
||
location / { | ||
root html/Shop-PHP-Yii2/data; | ||
} | ||
} | ||
|
||
server { | ||
listen 8001; | ||
server_name requirements.eleteam.com; | ||
|
||
location / { | ||
root html/Shop-PHP-Yii2; | ||
fastcgi_pass 127.0.0.1:9001; | ||
fastcgi_index requirements.php; | ||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | ||
include fastcgi_params; | ||
} | ||
} | ||
|
||
# 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; | ||
# } | ||
#} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,152 @@ | ||
#user nobody; | ||
#user root; | ||
worker_processes 1; | ||
|
||
error_log logs/error.log; | ||
|
||
events { | ||
worker_connections 1024; | ||
} | ||
|
||
|
||
http { | ||
include mime.types; | ||
default_type application/octet-stream; | ||
|
||
sendfile on; | ||
|
||
keepalive_timeout 65; | ||
|
||
#gzip on; | ||
|
||
server { | ||
listen 8002; | ||
server_name eleteam.com www.eleteam.com; | ||
|
||
location / { | ||
root html/Shop-PHP-Yii2/frontend/web; | ||
fastcgi_pass 127.0.0.1:9002; | ||
fastcgi_index index.php; | ||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | ||
include fastcgi_params; | ||
if (!-e $request_filename){ | ||
rewrite ^/(.*) /index.php last; | ||
} | ||
} | ||
|
||
location ~ /(css|js|f7|image|assets) { | ||
root html/Shop-PHP-Yii2/frontend/web; | ||
} | ||
} | ||
|
||
server { | ||
listen 8002; | ||
server_name m.eleteam.com; | ||
|
||
location / { | ||
root html/Shop-PHP-Yii2/wap/web; | ||
fastcgi_pass 127.0.0.1:9002; | ||
fastcgi_index index.php; | ||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | ||
include fastcgi_params; | ||
if (!-e $request_filename){ | ||
rewrite ^/(.*) /index.php last; | ||
} | ||
} | ||
|
||
location ~ /(css|js|f7|image|assets) { | ||
root html/Shop-PHP-Yii2/wap/web; | ||
} | ||
} | ||
|
||
server { | ||
listen 8002; | ||
server_name admin.eleteam.com; | ||
|
||
location / { | ||
root html/Shop-PHP-Yii2/backend/web; | ||
fastcgi_pass 127.0.0.1:9002; | ||
fastcgi_index index.php; | ||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | ||
include fastcgi_params; | ||
if (!-f $request_filename){ | ||
rewrite (.*) /index.php; | ||
} | ||
} | ||
|
||
location ~ /(css|js|f7|image|adminlte|assets|fonts|huiadmin|upload) { | ||
root html/Shop-PHP-Yii2/backend/web; | ||
} | ||
} | ||
|
||
server { | ||
listen 8002; | ||
server_name api.eleteam.com; | ||
|
||
location / { | ||
root html/Shop-PHP-Yii2/api/web; | ||
fastcgi_pass 127.0.0.1:9002; | ||
fastcgi_index index.php; | ||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | ||
include fastcgi_params; | ||
} | ||
} | ||
|
||
server { | ||
listen 8002; | ||
server_name data.eleteam.com; | ||
|
||
location / { | ||
root html/Shop-PHP-Yii2/data; | ||
} | ||
} | ||
|
||
server { | ||
listen 8002; | ||
server_name requirements.eleteam.com; | ||
|
||
location / { | ||
root html/Shop-PHP-Yii2; | ||
fastcgi_pass 127.0.0.1:9002; | ||
fastcgi_index requirements.php; | ||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | ||
include fastcgi_params; | ||
} | ||
} | ||
|
||
# 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; | ||
# } | ||
#} | ||
|
||
} |
Oops, something went wrong.