.map files get 404 response from the nginx proxy with nextjs in local development. The curious case of missing .map files

I’ve set up my local development using nginx as a proxy before my NextJS front end and Django backend. I want to mimic the live environment as much as possible – I’m running self-generated SSL certs too.

The problem is that when I go to my https://localdomain.xyz I see errors like these:

12:58:39.815 Source map error: request failed with status 404
Resource URL: https://localdomain.xyz/_next/static/chunks/app/(unauthenticated)/play/page.js
Source Map URL: react-toastify.esm.mjs.map

12:58:40.610 Source map error: request failed with status 404
Resource URL: null
Source Map URL: backendManager.js.map

12:58:40.611 Source map error: request failed with status 404
Resource URL: null
Source Map URL: react_devtools_backend_compact.js.map

12:58:46.333 Source map error: Error: request failed with status 404
Resource URL: https://localdomain.xyz/_next/static/css/app/layout.css?v=1716544718286
Source Map URL: ReactToastify.css.map

If I log in into the nextjs docker container, then the .next/static folder actually has none of the .map files. Also, when I skip the Nginx and just open the same page using HTTP://localhost:8000, then there are no .map file missing errors.

This makes me think it’s quite alright the .map files are not there. But, in that case, why would firefox running https://localdomain.xys think, the map files should be there? Is there any way to get rid of this error?

Other than that, everything works just fine, and my nginx config is like this:

server {
    listen 443 ssl;
    http2 on;
    server_name localdomain.xyz;
    include conf.d/shared/ssl.include;
    include conf.d/shared/ssl-common.include;

    # Nextjs
    location / {
        proxy_pass http://node:8000;
        include conf.d/shared/proxy.include;
    }

     location /_next/webpack-hmr {
         proxy_pass http://node:8000;
         proxy_http_version 1.1;
         proxy_set_header Upgrade $http_upgrade;
         proxy_set_header Connection "Upgrade";
         proxy_set_header Host $host;
         proxy_set_header X-Real-IP $remote_addr;
         proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
         proxy_set_header X-Forwarded-Proto $scheme;
     }

    # Proxying WebSocket connections to Django
    location /ws {
        proxy_pass http://django:80;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "Upgrade";
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }

    # Django
    location ~ ^/(api|adminpanel|accounts|_allauth|_health|media|assets) {
        proxy_pass http://django:80;
        include conf.d/shared/proxy.include;
    }

    # Mailhog
    location /mailhog {
        rewrite ^/mailhog/(.*)$ /$1 break;
        proxy_pass http://mailhog:8025;
        include conf.d/shared/proxy.include;
    }
}

and the included proxy.include is as follows:

proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Protocol $scheme;
proxy_set_header X-Forwarded-SSL on;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $http_host;

proxy_redirect off;

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật