我有一个文件夹index.html文件,并在该文件夹中,我有另一个与自己的index.html
我正在使用这个configuration
events { worker_connections 2048; } http { server { listen 6666; server_name 0.0.0.0; root /static; index index.html; charset utf-8; location / { include /etc/nginx/mime.types; types {font/truetype ttf;} types {application/font-woff2 woff2;} } location /test { alias /static/test; } } }
Nginx运行在docker容器下
有我的docker – 撰写
version: '2' services: serve_site: container_name: server build: context: . dockerfile: ./docker/Dockerfile-nginx volumes: - ./www-public:/static ports: - "80:6666"
和Dockerfile
FROM nginx:alpine MAINTAINER Viktor Dzundza <[email protected]> ENV REFRESHED_AT 20170112:000001 ENV HOME=/static RUN mkdir $HOME COPY ./www-public $HOME/ WORKDIR $HOME COPY nginx.conf /etc/nginx/nginx.conf RUN set -x ; \ addgroup -g 82 -S www-data ; \ adduser -u 82 -D -S -G www-data www-data && exit 0 ; exit 1 RUN chown -R www-data:www-data /static/* RUN chmod -R 0755 /static/* CMD ["nginx", "-g", "daemon off;"]
但是我认为nginxconfiguration的问题。
当我尝试去本地/testing浏览器被redirect到本地主机:6666 /testing
如何configurationnginx来解决这个问题?