Skip to content

Instantly share code, notes, and snippets.

@tao12345666333
Last active September 7, 2019 01:45
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tao12345666333/f4441176550848c065569cc74d7a8324 to your computer and use it in GitHub Desktop.
Save tao12345666333/f4441176550848c065569cc74d7a8324 to your computer and use it in GitHub Desktop.
多个vue前端项目使用同一域名nginx配置
upstream api {
server localhost:6663;
}
server {
listen 80;
server_name moelove.info;
charset utf-8;
root /www/moelove;
index index.html index.html;
location /blog {
try_files $uri $uri/ /blog/index.html;
}
location /vim {
try_files $uri $uri/ /vim/index.html;
}
location ~ ^/(api) {
proxy_pass http://api;
}
location / {
default_type 'text/plain';
content_by_lua "ngx.say('Hello moelove!')";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment