-
Notifications
You must be signed in to change notification settings - Fork 651
/
nginx.conf.sample
71 lines (64 loc) · 2.04 KB
/
nginx.conf.sample
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
##
# Nginx用の設定サンプル。
# ホスト名やSSL証明書は適時自分の環境に合わせてください。
##
# Default server configuration
#
server {
listen 80;
server_name eccube.example.com;
return 301 https://$host$request_uri;
}
server {
# SSL configuration
#
listen 443 ssl http2;
server_name eccube.example.com;
# listen [::]:443 ssl default_server;
#
# Note: You should disable gzip for SSL traffic.
# See: https://bugs.debian.org/773332
#
# Read up on ssl_ciphers to ensure a secure configuration.
# See: https://bugs.debian.org/765782
#
# Self signed certs generated by the ssl-cert package
# Don't use them in a production server!
#
# include snippets/snakeoil.conf;
ssl_certificate /etc/letsencrypt/live/eccube.example.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/eccube.example.com/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
root /var/www/html;
# Add index.php to the list if you are using PHP
index index.php index.html index.htm index.nginx-debian.html;
location / {
# IP制限設定
# allow 133.242.241.52; #アクセスを許可するIPアドレス
# deny all;
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ /index.php?$args;
}
# pass PHP scripts to FastCGI server
#
location ~ \.php$ {
# include snippets/fastcgi-php.conf; # Ubuntu用
# With php-fpm (or other unix sockets):
fastcgi_pass unix:/var/run/php/php-fpm.sock;
# With php-cgi (or other tcp sockets):
# fastcgi_pass 127.0.0.1:9000;
}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
# ここから下は変更するとセキュリティ的に危険なので変更しない事
#
location ~ /\. {
deny all;
}
location ~^/(var|test|vendor|app|src|bin) {
deny all;
}
}