A
A
Anton2016-07-13 12:32:05
Nginx
Anton, 2016-07-13 12:32:05

Why doesn't nginx render the css file completely?

Hello!
The next problem is that nginx gives away about 70-80% of the contents of the style files, while the size of the file does not interest it.
For example the following content

@font-face {
    font-family: 'Roboto';
    src: url('../fonts/Roboto-Italic-webfont.eot');
    src: url('../fonts/Roboto-Italic-webfont.eot?#iefix') format('embedded-opentype'),
    url('../fonts/Roboto-Italic-webfont.woff2') format('woff2'),
    url('../fonts/Roboto-Italic-webfont.woff') format('woff'),
    url('../fonts/Roboto-Italic-webfont.ttf') format('truetype');
    font-weight: normal;
    font-style: italic;
}

will be given as:
@font-face {
    font-family: 'Roboto';
    src: url('../fonts/Roboto-Italic-webfont.eot');
    src: url('../fonts/Roboto-Italic-webfont.eot?#iefix') format('embedded-opentype'),
    url('../fonts/Roboto-Italic-webfont.woff2') format('woff2'),
    url('../fonts/Roboto-Italic-webfont.woff') format('woff'),
    url('../fonts/Roboto-Italic-webfont.ttf') format('truetype');
    font-weight: normal;
    font-style: it

config files are the following.
user www-data;
worker_processes 4;
pid /run/nginx.pid;

events {
        worker_connections 768;
        # multi_accept on;
}

http {

    client_max_body_size 200M;
    include       /etc/nginx/mime.types;
    default_type  application/octet-stream;

    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

    access_log  /var/log/nginx/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    keepalive_timeout  65;

    #gzip  on;

    include /home/anton/server/conf/*;
}

host
server {
        listen 80;
        root /home/anton/server/www/mydomain/account;
        index index.php;

        server_name mydomain.lc;

        location / {
                rewrite ^/(.*)$ /index.php last;
        }

  location /static/ {}

        location ~ \.php$ {
                fastcgi_pass    127.0.0.1:9000;
                fastcgi_index   index.php;
                fastcgi_param   SCRIPT_FILENAME $document_root$fastcgi_script_name;
                include         fastcgi_params;
        }
}

css is requested from mydomain.lc/static/styles/style.css

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Anton, 2016-07-13
@AntonMinsk

The problem was not in nginx
Everything is arranged as follows:
1. MAC OS as a host system
2. Ubuntu on virtualbox as a web server
, the project files are on mac os and mounted on ubuntu as a shared folder, this is where the problem arose, what was saved on the poppy was crooked already displayed on ubuntu.
how to treat it is not clear, got out the organization of the scheme without a shared folder

V
Viktor Taran, 2016-07-15
@shambler81

Oddly enough, this can be called using nginx, and this has already happened when you force nginx to cache static content in this case, an interesting glitch associated with last modefight came out. As a result, a static file is displayed before the place of change;)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question