Nginx behid traefik reach 404

Hello :slight_smile:

I'm trying to host simple static file server, and i find this solution:

I also tried on origin nginx without any good result.
Also with this guide:

Nginx without traefik work nice, i want to use traefik because i really need https, and simple url without port. Maybe here is other solution which i can use.

Anyway here is my docker-compose:

  image: flashspys/nginx-static
  container_name: {}
    - 180/tcp
    - 180:180
    - "traefik.enable=true"
    - ""         
    - "traefik.http.routers.nginxrouter.rule=Host(``)"
    - "traefik.http.routers.nginxrouter.entrypoints=web"
    - "traefik.http.servives.nginxrouter.loadbalancer.server.port=180"
    - "traefik.http.routers.nginxrouter.redirect@file"
    - "traefik.http.routers.nginxroutersecured.rule=Host(``)"
    - "traefik.http.routers.nginxroutersecured.tls=true"
    - "traefik.http.routers.nginxroutersecured.entrypoints=websecure"
    - "traefik.http.routers.nginxrouter.tls.certresolver=myresolver"
    - /absolute/path/to/staticFiles:/static    

Below i have default.conf file (changed port from 80 to 180 because traefik listen on port 80):

server {
listen 180;
server_name localhost;
location / {
root /static;
index index.html index.htm;

I always get 404 when try to reach:
http:// /fileName.test //with space because this url exist :smiley:

I host other services on traefik (about 10 container) and everything work perfect.

Just a typo error ? servives

@cakiwi Thanks a lot, but in my case problem was caused by network config.

Below is my configFile:

1 Like