简体   繁体   English

如何使用杠杆浏览器为angular应用编写nginx conf文件

[英]how to write nginx conf file for angular app with Leverage browser

After building the angular app, 构建了角度应用之后,

when I run the docker file, I'm not able to load the page, 当我运行docker文件时,无法加载页面,

inside my console it gives me this waring: 在控制台内,它给了我这个警告:

在此处输入图片说明

Here is my nginx-custom.conf file: 这是我的nginx-custom.conf文件:

server {
   listen 80;
   location / {
   root /usr/share/nginx/html;
   index index.html index.htm;
   try_files $uri $uri/ /index.html =404;
   }
   location ~*  \.(jpg|jpeg|png|gif|ico|css|js)$ {
       expires 365d;
   }
}

DockerFile: DockerFile:

FROM nginx:1.13
COPY  dist/ /usr/share/nginx/html
COPY ./nginx-custom.conf /etc/nginx/conf.d/default.conf
# Expires map
  map $sent_http_content_type $expires {
  default                    off;
  text/html                  epoch;
  text/css                   max;
  application/javascript     max;
  ~image/                    max;
  }

  server {
  listen 80;
  location / {
  root /usr/share/nginx/html;
  index index.html index.htm;
  try_files $uri $uri/ /index.html =404;
  }
 }

here is the reference url 这是参考网址

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM