[GH-ISSUE #30] got "unexpected token" with the follow nginx config file at line 45 ("text/css") #15

Closed
opened 2026-02-28 01:20:30 +03:00 by kerem · 2 comments
Owner

Originally created by @CaryChy on GitHub (Nov 15, 2023).
Original GitHub issue: https://github.com/tufanbarisyildirim/gonginx/issues/30

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;
        }
        	
    }
	

}
Originally created by @CaryChy on GitHub (Nov 15, 2023). Original GitHub issue: https://github.com/tufanbarisyildirim/gonginx/issues/30 ``` 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; } } } ```
kerem 2026-02-28 01:20:30 +03:00
  • closed this issue
  • added the
    bug
    v2
    labels
Author
Owner

@CaryChy commented on GitHub (Nov 15, 2023):

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

<!-- gh-comment-id:1813478974 --> @CaryChy commented on GitHub (Nov 15, 2023): seems this issue was caused by line 43 ("gzip_types") ends without ";"
Author
Owner

@tufanbarisyildirim commented on GitHub (Feb 20, 2026):

Thanks for reporting this. I re-checked this against current main and could not reproduce the parser error anymore.

I used the config from this issue and parsed it with parser.NewStringParser(...).Parse(); it succeeds on current code.

Given that current behavior is correct, I’m closing this as resolved. If you can still reproduce with the latest version, please reopen with a minimal config snippet and exact error output.

<!-- gh-comment-id:3932147739 --> @tufanbarisyildirim commented on GitHub (Feb 20, 2026): Thanks for reporting this. I re-checked this against current `main` and could not reproduce the parser error anymore. I used the config from this issue and parsed it with `parser.NewStringParser(...).Parse()`; it succeeds on current code. Given that current behavior is correct, I’m closing this as resolved. If you can still reproduce with the latest version, please reopen with a minimal config snippet and exact error output.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/gonginx#15
No description provided.