tufanbarisyildirim / gonginx

Nginx configuration parser helps you to parse, edit, regenerate your nginx config in your go applications
https://github.com/tufanbarisyildirim/gonginx
MIT License
176 stars 48 forks source link

got "unexpected token" with the follow nginx config file at line 45 ("text/css") #30

Open CaryChy opened 11 months ago

CaryChy commented 11 months ago
worker_processes 1;

events {

    worker_connections 1024;
}

## rtmp {
## 
##     server {
## 
##         listen 10935;
## 
##         application live {
## 
##             live on;
##         }
## 
##         application hls {
## 
##             live on;
##             hls on;
##             hls_path temp/hls;
##             hls_fragment 8s;
##         }
##     }
## }

http {

    include mime.types;
    default_type application/octet-stream;

    sendfile on;
    keepalive_timeout 65;
    # Enable Gzip
    gzip on;
    gzip_http_version 1.0;
    gzip_comp_level 2;
    gzip_min_length 1100;
    gzip_buffers 4 8k;
    gzip_proxied any;
    gzip_types
    # text/html is always compressed by HttpGzipModule
    text/css
    text/javascript
    text/xml
    text/plain
    text/x-component
    application/javascript
    application/json
    application/xml
    application/rss+xml
    font/truetype
    font/opentype
    application/vnd.ms-fontobject
    image/svg+xml;

    gzip_static on;

    gzip_proxied expired no-cache no-store private auth;
    gzip_disable "MSIE [1-6]\.";
    gzip_vary on;

    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  logs/access.log  main;
    access_log off;

    client_max_body_size 20m;
    server {

        listen 4600;

        server_name platform_style;

        proxy_buffer_size 1024k;
        proxy_buffers 16 1024k;
        proxy_busy_buffers_size 2048k;
        proxy_temp_file_write_size 2048k;

        location /platform/ {

            proxy_pass http://127.0.0.1:5000/platform/;
        }

        ## location /stat {
        ## 
        ##     rtmp_stat all;
        ##     rtmp_stat_stylesheet stat.xsl;
        ## }

        location /stat.xsl {

            root html;
        }

        location /hls {

            #server hls fragments
            types {

                application/vnd.apple.mpegurl m3u8;
                video/mp2t ts;
            }
            alias temp/hls;
            expires -1;
        }

        error_page 500 502 503 504 /50x.html;
        location = /50x.html {

            root html;
        }

    }

}
CaryChy commented 11 months ago

seems this issue was caused by line 43 ("gzip_types") ends without ";"