基本转发

转发前端资源和后端服务,前端资源为统一目录,毋需修改配置

server {
   listen       80;
   listen       [::]:80;
   server_name  _;
   #root         /usr/share/nginx/html;

   # Load configuration files for the default server block.
   include /etc/nginx/default.d/*.conf;

   location ~ ^/(static)/ {
      root /home/homework/webroot;
   }
   location ~ \.html$ {
      root /home/homework/webroot;
   }
   location ~* ^/+workflow/.* {
      proxy_pass http://127.0.0.1:8080;
   }

   error_page 404 /404.html;
   location = /404.html {
   }

   error_page 500 502 503 504 /50x.html;
   location = /50x.html {
   }
}