R
R
Rag'n' Code Man2021-06-25 14:42:21
Nginx
Rag'n' Code Man, 2021-06-25 14:42:21

Why is the same HTML inside all site files?

I am deploying a site on NGINX, and suddenly it stopped working, and if you open this HTML just in a browser, then about the same errors come out (if you open it locally, then CORS also complains)

60d5c09a0ccd6234792691.png
60d5c0b4b4225330845544.png

Why is HTML in all the files? Bootstrap.css contains HTML if you look through the inspector, JS chunks contain HTML, but if you open these files through the explorer, then there are no problems - manifest.json contains json, css files contain css.

Here is the server config:

worker_processes auto;

events {
    worker_connections 1024;
    multi_accept on;
    accept_mutex on;
}

http {
    # Types
    include mime.types;

    # Security
    server_tokens off;

    # Response compressing
    gzip on;
    gzip_comp_level 3;
    gzip_min_length 1000;
    gzip_http_version 1.1;
    gzip_vary on;
    gzip_disable "MSIE [4-6] \.";

    # Request Body Config
    client_body_buffer_size 8k;
    client_body_timeout 10s;
    client_max_body_size 2m;
    large_client_header_buffers 4 8k;

    # Request Header Config
    client_header_timeout 5s;

    # Files Caching
    open_file_cache max=1000 inactive=30s;
    open_file_cache_valid 30s;
    open_file_cache_min_uses 4;
    open_file_cache_errors on;

    # Waiting Time
    keepalive_timeout 30s;
    keepalive_requests 30;
    send_timeout 30s;

    server {
        listen 80;
        root html/build/;

        location / {
            rewrite ^ /index.html break;
        }

        location = /CRMAccounts/ {
            proxy_pass http://localhost:4200/CRMAccounts/;
        }

        location /CRM/ {
            proxy_pass http://localhost:4200/CRM/;
        }
    }
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
vreitech, 2021-06-25
@fzfx

> Why all files contain HTML?
firstly, not in all, secondly, not in files, but by URI ...
because here you have said for all URIs, except for those that start with /CRM/ and /CRAAccount/, to display the contents of the file index.html:

server {
        listen 80;
        root html/build/;

        location / {
            rewrite ^ /index.html break;
        }

        location = /CRMAccounts/ {
            proxy_pass http://localhost:4200/CRMAccounts/;
        }

        location /CRM/ {
            proxy_pass http://localhost:4200/CRM/;
        }
    }

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question