I've one folder index.html file and inside that folder, I have another one with own index.html
I am using this config
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 is run under docker container
There is my docker-compose
version: '2'
services:
serve_site:
container_name: server
build:
context: .
dockerfile: ./docker/Dockerfile-nginx
volumes:
- ./www-public:/static
ports:
- "80:6666"
And Dockerfile
FROM nginx:alpine
MAINTAINER Viktor Dzundza <victor.dzundza.dev@gmail.com>
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;"]
But I think that problem with nginx configuration.
When I am trying to go localhost/test the browser is redirected to the localhost:6666/test
How can I configure nginx for solving this issue?