목차
nginx woff mime type error 설정 해결 방법 Unexpected character in input: 에러
2019/07/25 15:19:07 [error] 25892#24016: *313 FastCGI sent in stderr: "PHP Warning: Unexpected character in input: '' (ASCII=11) state=0 in C:\work\cj_003\dcms-ui\assets\fonts\glyphicons-halflings-regular.woff2 on line 100
PHP Warning: Unexpected character in input: '' (ASCII=16) state=0 in C:\work\cj_003\dcms-ui\assets\fonts\glyphicons-halflings-regular.woff2 on line 100
PHP Warning: Unexpected character in input: '' (ASCII=127) state=0 in C:\work\cj_003\dcms-ui\assets\fonts\glyphicons-halflings-regular.woff2 on line 100
PHP Warning: Unexpected character in input: '' (ASCII=8) state=0 in C:\work\cj_003\dcms-ui\assets\fonts\glyphicons-halflings-regular.woff2 on line 100
PHP Parse error: syntax error, unexpected '�' (T_STRING), expecting ',' or ')' in C:\work\cj_003\dcms-ui\assets\fonts\glyphicons-halflings-regular.woff2 on line 100" while reading response header from upstream, client: 127.0.0.1, server: localhost, request: "GET /assets/fonts/glyphicons-halflings-regular.woff2 HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "local-cocos.cjenm.com:9001", referrer: "http://local-cocos.cjenm.com:9001/main/"
2019/07/25 15:19:07 [error] 25892#24016: *313 FastCGI sent in stderr: "PHP Warning: Unexpected character in input: '' (ASCII=11) state=0 in C:\work\cj_003\dcms-ui\assets\fonts\glyphicons-halflings-regular.woff2 on line 100
PHP Warning: Unexpected character in input: '' (ASCII=16) state=0 in C:\work\cj_003\dcms-ui\assets\fonts\glyphicons-halflings-regular.woff2 on line 100
PHP Warning: Unexpected character in input: '' (ASCII=127) state=0 in C:\work\cj_003\dcms-ui\assets\fonts\glyphicons-halflings-regular.woff2 on line 100
PHP Warning: Unexpected character in input: '' (ASCII=8) state=0 in C:\work\cj_003\dcms-ui\assets\fonts\glyphicons-halflings-regular.woff2 on line 100
PHP Parse error: syntax error, unexpected '�' (T_STRING), expecting ',' or ')' in C:\work\cj_003\dcms-ui\assets\fonts\glyphicons-halflings-regular.woff2 on line 100" while reading response header from upstream, client: 127.0.0.1, server: localhost, request: "GET /assets/fonts/glyphicons-halflings-regular.woff2 HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "local-cocos.cjenm.com:9001", referrer: "http://local-cocos.cjenm.com:9001/main/"
mime.types 파일에서 font/woff 대신에 application/font-woff 를 써 준다.
font/woff woff; font/woff2 woff2;
application/font-woff woff;
application/font-woff2 woff2;
nginx.conf 파일에서
location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webm|htc)$ { expires 1M; access_log off; add_header Cache-Control "public"; }
location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webm|htc)$ { expires 1M; access_log off; add_header Cache-Control "public"; }
woff,woff2를 추가 해준다.
location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|ogg|woff|woff2|ogv|webm|htc)$ { expires 1M; access_log off; add_header Cache-Control "public"; }
Nginx mime type 설정이 잘못 되면, 크롬이나 오페라 등의 브라우저에서는 큰 티가 안나지만, IE나 엣지 브라우저에서는 CSS가 선택적으로 먹혀서 화면이 흐트러지는 에러가 나온다.
예컨데, input button에 value 값을 마이너스 인덴트로 가리려고 해도, overflow:hidden이 안먹는다던가 해당 클래스가 적용되지 않는 문제가 생긴다.
'Lect & Tip > Nginx & PHP 7.0' 카테고리의 다른 글
리눅스에서 Mattermost를 HTTPS(SSL)로 운영하는 방법 (0) | 2024.08.15 |
---|
댓글