server {
listen 80;
listen [::]:80;
server_name uniapp.com;
root /var/www/mobile/dist/build/h5;
index index.html;
location / {
try_files $uri $uri/ /index.html;
}
location ~* ^/(?!view/).*\.(css|js|png|jpg|jpeg|gif|ico|svg|woff2?|ttf|otf|eot|json)$ {
try_files $uri =404;
access_log off;
expires 1y;
add_header Cache-Control "public, immutable";
}
location /view/ {
proxy_pass http://127.0.0.1:3002;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
location /api/ {
proxy_pass http://127.0.0.1:3000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}
server {
listen 80;
listen [::]:80;
server_name purevue.com;
root /var/www/dist;
index index.html;
location / {
try_files $uri $uri/ /index.html;
}
location ~* \.(css|js|png|jpg|jpeg|gif|ico|svg|woff2?|ttf|otf|eot|json)$ {
try_files $uri =404;
access_log off;
expires 1y;
}
location /api/ {
proxy_pass http://127.0.0.1:3000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}