Created
April 23, 2014 14:23
-
-
Save kidach1/11217194 to your computer and use it in GitHub Desktop.
Nginx導入時、サクッと対応しておくと良いかもしれない ref: http://qiita.com/kidachi_/items/985efebba639713c562e
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
geo $allow_ip { | |
default 0; | |
93.184.216.119 1; # 自社IP | |
xx.xxx.xxx.xxx 1; # 支社IP1 | |
yy.yyy.yyy.yyy 1; # 支社IP2 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ service crond status | |
crond は停止しています | |
$ sudo service crond start | |
crond を起動中: [ OK ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server{ | |
~ | |
location ~ .*\.(html?|jpe?g|gif|png|css|js|ico|woff) { | |
expires 10d; | |
access_log off; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ service crond status | |
crond は停止しています | |
$ sudo service crond start | |
crond を起動中: [ OK ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ service crond status | |
crond は停止しています | |
$ sudo service crond start | |
crond を起動中: [ OK ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ service crond status | |
crond は停止しています | |
$ sudo service crond start | |
crond を起動中: [ OK ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[root@localhost ~]# cat /usr/share/nginx/html/index.html | |
Not Found |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http { | |
server_tokens off; | |
~ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
~ | |
location /favicon { | |
empty_gif; | |
access_log off; | |
log_not_found off; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
upstream sample_app_443 { | |
server unix:/tmp/unicorn.sock; | |
} | |
server{ | |
~ | |
# SSL対応したいページはそのままsample_app_443へ。 | |
location ~ ^/user/info { | |
proxy_pass http://sample_app_443; | |
break; | |
} | |
# その他ページはHTTP(80)へrewrite。 | |
location ~* / { | |
rewrite ^(.*) http://$http_host$1; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment