|
| 1 | +server { |
| 2 | + #listen [::]:80 ipv6only=on; # listen for IPv6 |
| 3 | + server_name docker.my; |
| 4 | + root /var/www/html/yii; |
| 5 | + |
| 6 | + access_log /var/log/nginx/new-access.log; |
| 7 | + error_log /var/log/nginx/new-error.log; |
| 8 | + charset utf-8; |
| 9 | + client_max_body_size 100M; |
| 10 | + |
| 11 | + location / { |
| 12 | + root /var/www/html/yii/frontend/web/; |
| 13 | + try_files $uri /index.php?$args; |
| 14 | + } |
| 15 | + |
| 16 | + |
| 17 | + location ~* \.php$ { |
| 18 | + try_files $uri /frontend/web$uri =404; |
| 19 | + # check the www.conf file to see if PHP-FPM is listening on a socket or a port |
| 20 | + fastcgi_pass phpfpm:9000; |
| 21 | + #fastcgi_pass 127.0.0.1:9000; # listen for port |
| 22 | + include /etc/nginx/fastcgi_params; |
| 23 | + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; |
| 24 | + } |
| 25 | + |
| 26 | + # avoid processing of calls to non-existing static files by Yii (uncomment if necessary) |
| 27 | + #location ~* \.(css|js|jpg|jpeg|png|gif|bmp|ico|mov|swf|pdf|zip|rar)$ { |
| 28 | + # access_log off; |
| 29 | + # log_not_found off; |
| 30 | + # try_files $uri /frontend/web$uri =404; |
| 31 | + #} |
| 32 | + |
| 33 | + location ~* \.(htaccess|htpasswd|svn|git) { |
| 34 | + deny all; |
| 35 | + } |
| 36 | + |
| 37 | + |
| 38 | + |
| 39 | + location /api { |
| 40 | + alias /var/www/html/yii/frontend/web; |
| 41 | + try_files $uri /frontend/web/index.php?$args; |
| 42 | + |
| 43 | + # redirect to the page without a trailing slash (uncomment if necessary) |
| 44 | + #location = /admin/ { |
| 45 | + # return 301 /admin; |
| 46 | + #} |
| 47 | + |
| 48 | + location ~* ^/admin/(.+\.php)$ { |
| 49 | + try_files $uri /frontend/web/1ドル?$args; |
| 50 | + } |
| 51 | + |
| 52 | + # avoid processing of calls to non-existing static files by Yii (uncomment if necessary) |
| 53 | + #location ~* ^/admin/(.+\.(css|js|jpg|jpeg|png|gif|bmp|ico|mov|swf|pdf|zip|rar))$ { |
| 54 | + # try_files $uri /frontend/web/1ドル?$args; |
| 55 | + #} |
| 56 | + } |
| 57 | + |
| 58 | + |
| 59 | + |
| 60 | + location /admin { |
| 61 | + alias /var/www/html/yii/backend/web; |
| 62 | + try_files $uri /backend/web/index.php?$args; |
| 63 | + |
| 64 | + # redirect to the page without a trailing slash (uncomment if necessary) |
| 65 | + #location = /admin/ { |
| 66 | + # return 301 /admin; |
| 67 | + #} |
| 68 | + |
| 69 | + location ~* ^/admin/(.+\.php)$ { |
| 70 | + try_files $uri /backend/web/1ドル?$args; |
| 71 | + } |
| 72 | + |
| 73 | + # avoid processing of calls to non-existing static files by Yii (uncomment if necessary) |
| 74 | + #location ~* ^/admin/(.+\.(css|js|jpg|jpeg|png|gif|bmp|ico|mov|swf|pdf|zip|rar))$ { |
| 75 | + # try_files $uri /backend/web/1ドル?$args; |
| 76 | + #} |
| 77 | + } |
| 78 | + |
| 79 | + |
| 80 | + location /images/ { |
| 81 | + root /var/www/html/; |
| 82 | + } |
| 83 | + |
| 84 | + |
| 85 | + |
| 86 | + |
| 87 | +} |
0 commit comments