๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
Lect & Tip/Nginx & PHP 7.0

โœˆ nginx woff mime type error ์„ค์ • ํ•ด๊ฒฐ ๋ฐฉ๋ฒ• Unexpected character in input: ์—๋Ÿฌ

by ๋‚ฏ์„ ๊ณต๊ฐ„2019 2019. 7. 26.

๋ชฉ์ฐจ

    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์ด ์•ˆ๋จน๋Š”๋‹ค๋˜๊ฐ€ ํ•ด๋‹น ํด๋ž˜์Šค๊ฐ€ ์ ์šฉ๋˜์ง€ ์•Š๋Š” ๋ฌธ์ œ๊ฐ€ ์ƒ๊ธด๋‹ค.

     ์ผ๋ฐ˜์ธ ๋ชธ๋งค ๊ฐ์„ ๋ฏธ

    ๋ฐ˜์‘ํ˜•

    ๋Œ“๊ธ€