1、訪問 網站 http://stm.feifupt.com/#/ 實現跳轉官網
2、訪問 http://stm.feifupt.com/screen/ 實現跳轉大屏
3、訪問 http://stm.feifupt.com/stm/#/ 也是實現跳轉官網
4、nginx配置如下
user root;
worker_processes 2;
worker_rlimit_nofile 4096;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
pid /var/run/nginx.pid;
events {
worker_connections 2048;
}
http {
include mime.types;
default_type application/octet-stream;
client_max_body_size 50m;
#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;
server {
listen 80;
listen 443 ssl;
server_name 139.224.244.168;
#return 301 https://$server_name$request_uri;
#charset koi8-r;
#必須配置
root /home/stm/html/;
ssl_certificate /usr/local/nginx/cert/3091625_stm.feifupt.com.pem;
ssl_certificate_key /usr/local/nginx/cert/3091625_stm.feifupt.com.key;
#access_log logs/host.access.log main;
gzip on;
gzip_min_length 1k;
gzip_buffers 4 16k;
gzip_http_version 1.1;
gzip_comp_level 6;
gzip_types text/plain text/css application/javascript application/x-javascript application/xml text/javascript application/json;
gzip_vary on;
location /stmApi/ {
proxy_pass http://localhost:28080/;
proxy_set_header X-real-ip $remote_addr;
}
location /stmControlApi/ {
proxy_pass http://localhost:28081/;
proxy_set_header X-real-ip $remote_addr;
}
#靜態文件壓縮
location /stm{
root /home/stm/html;
index index.html index.htm;
autoindex off;
}
//訪問 http://stm.feifupt.com/ 定向到 上面的配置
location /{
try_files $uri/stm/index.html index.htm;
}
#靜態文件未壓縮
location /screen{
root /home/stm/html;
index index.html index.htm;
autoindex off;
}
//文件訪問 /home/stm/uploads/file/
location /file/ {
root /home/stm/uploads/;
}
// 開啓gizp壓縮靜態文件
location ~* \.(html|css|js|ttf)$ {
gzip_static on;
}
location = /50x.html {
root html;
}
}
}
6、