LoginSignup
0
0

More than 5 years have passed since last update.

Nginxで静的コンテツを読み込むようにするために

Posted at

経緯

  • 昨日、Redmineの前面にNginxを置いてcacheとSSLオフロードかましてうはうは楽しんでたらCSSやJS読み込まれなくなったことに昨晩気がつく。。。

どうするの?

  • 修正した箇所となぜそれが必要なのかを残しておく

設定を変更した箇所

location /xxxx/ {
    proxy_pass http://127.0.0.1:xxxx/;
}

~割愛~

location ~ .*\.(html?|jpe?g|gif|pdf|png|css|js|ico|swf|inc) {
    expires 1d;
    access_log off;
 }
location ~/xxxx/ {       <--ここ
    proxy_pass http://127.0.0.1:xxxx/;
}

~割愛~

location ~ .*\.(html?|jpe?g|gif|pdf|png|css|js|ico|swf|inc) {
    expires 1d;
    access_log off;
 }

教訓

  • モジラで生成したコンフィグを元にやっていましたが、細かいところの設定は見直さないとね。。。

参考サイト(多謝)

https://www.lancard.com
paulownia.hatenablog.com
Nginx公式ドキュメント

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0