You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
iot/tools/nginx-1.16.0/conf/nginx.conf

78 lines
2.0 KiB

#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;
sendfile on;
keepalive_timeout 65;
upstream go-fastdfs {
server 10.10.24.104:8180;
ip_hash;
}
server {
listen 0.0.0.0:80;
server_name localhost;
location / {
#proxy_set_header Host $host:$server_port;
proxy_pass http://localhost:5001/;
if ($http_user_agent ~* "(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino") {
#rewrite ^(.*) http://localhost:5002$1 permanent;
proxy_pass http://localhost:5002;
}
}
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://localhost:8010/UserCenter/;
}
location ^~ /IoTCenter/ {
proxy_pass http://localhost:8011/IoTCenter/;
}
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";
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
}