|
|
#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;
|
|
|
types {
|
|
|
application/vnd.android.package-archive apk;
|
|
|
application/iphone pxl ipa;
|
|
|
text/plain plist;
|
|
|
}
|
|
|
|
|
|
sendfile on;
|
|
|
|
|
|
keepalive_timeout 65;
|
|
|
|
|
|
upstream go-fastdfs {
|
|
|
server 10.10.24.104:8180;
|
|
|
ip_hash;
|
|
|
}
|
|
|
|
|
|
server {
|
|
|
listen 80;
|
|
|
#listen 443 ssl;
|
|
|
server_name iot.edusoa.com;
|
|
|
|
|
|
#ssl on;
|
|
|
ssl_certificate edusoa.pem;
|
|
|
ssl_certificate_key edusoa.key;
|
|
|
ssl_session_timeout 5m;
|
|
|
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
|
|
|
#启用TLS1.1、TLS1.2要求OpenSSL1.0.1及以上版本,若您的OpenSSL版本低于要求,请使用 ssl_protocols TLSv1;
|
|
|
ssl_ciphers HIGH:!RC4:!MD5:!aNULL:!eNULL:!NULL:!DH:!EDH:!EXP:+MEDIUM;
|
|
|
ssl_prefer_server_ciphers on;
|
|
|
|
|
|
set $ip 'localhost';
|
|
|
|
|
|
location / {
|
|
|
#proxy_set_header Host $host:$server_port;
|
|
|
if ($http_user_agent ~* "(mobile|android|ipad|iphone|ipod|tablet)") {
|
|
|
proxy_pass http://localhost:5002;
|
|
|
break;
|
|
|
}
|
|
|
proxy_pass http://localhost:5001/;
|
|
|
}
|
|
|
|
|
|
location ^~ /dfs/ {
|
|
|
proxy_set_header Host $host;
|
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
|
proxy_pass http://go-fastdfs/;
|
|
|
}
|
|
|
|
|
|
location ^~ /live/ {
|
|
|
proxy_pass http://localhost:8080/live/;
|
|
|
}
|
|
|
|
|
|
location ^~ /video/ {
|
|
|
proxy_pass http://localhost:8080/video/;
|
|
|
}
|
|
|
|
|
|
location ^~ /UserCenter/ {
|
|
|
proxy_pass http://[$ip]:8010/UserCenter/;
|
|
|
proxy_set_header Host $host:$server_port;
|
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
|
}
|
|
|
|
|
|
location ^~ /IoTCenter/ {
|
|
|
proxy_pass http://localhost:8011/IoTCenter/;
|
|
|
proxy_set_header Host $host:$server_port;
|
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
|
}
|
|
|
|
|
|
location ^~ /IoTCenter/hub {
|
|
|
proxy_pass http://localhost:8011/IoTCenter/hub;
|
|
|
proxy_http_version 1.1;
|
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
|
proxy_set_header Connection "upgrade";
|
|
|
}
|
|
|
|
|
|
location ^~ /JobServer/ {
|
|
|
proxy_pass http://localhost:8013/JobServer/;
|
|
|
proxy_set_header Host $host:$server_port;
|
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
|
}
|
|
|
|
|
|
error_page 500 502 503 504 /50x.html;
|
|
|
location = /50x.html {
|
|
|
root html;
|
|
|
}
|
|
|
}
|
|
|
} |