markdown NGINX PHP 7.2 LARAVEL 5.6
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了markdown NGINX PHP 7.2 LARAVEL 5.6相关的知识,希望对你有一定的参考价值。
# NGINX Configuration
Fichier placé dans ```shell /etc/nginx/site-avialables/exemple``` .
## Fichier exemple de configuration pour NGINX avec PHP 7.2 et LARAVEL 5.6
```shell
server {
root /var/www/site_web/laravel/public;
index index.php index.html index.htm;
server_name exemple.com www.exemple.com;
charset utf-8;
add_header X-Frame-Options "SAMEORIGIN";
add_header X-XSS-Protection "1; mode=block";
add_header X-Content-Type-Options "nosniff";
location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
gzip on;
gzip_vary on;
gzip_disable "msie6";
gzip_comp_level 6;
gzip_min_length 1100;
gzip_buffers 16 8k;
gzip_proxied any;
gzip_types
text/plain
text/css
text/js
text/xml
text/javascript
application/javascript
application/x-javascript
application/json
application/xml
application/xml+rss;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
try_files $uri /index.php =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/run/php/php7.2-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webm|htc|svg|woff|woff2|ttf)$ {
expires 1M;
access_log off;
add_header Cache-Control "public";
}
location ~* \.(?:css|js)$ {
expires 7d;
access_log off;
add_header Cache-Control "public";
}
location ~ /\.ht {
deny all;
}
listen [::]:443 ssl ipv6only=on; # managed by Certbot
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/exemple.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/exemple.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
}
server {
if ($host = www.exemple.com) {
return 301 https://$host$request_uri;
} # managed by Certbot
if ($host = exemple.com) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80;
listen [::]:80;
server_name exemple.com.pw www.exmple.com;
return 404; # managed by Certbot
}
```
以上是关于markdown NGINX PHP 7.2 LARAVEL 5.6的主要内容,如果未能解决你的问题,请参考以下文章
markdown [安装Xdebug]在Valet上为PHP 7.2安装Xdebug #valet #php #test #xdebug
nginx PHP 7.2 安装
markdown 安装Oracle PHP扩展(oracle OCI8) - 适用于Mac OS 10.12.6的即时客户端 - 自制环境 - 在PHP 7.2上
对等方重置连接-同时使用 nginx 和 php-fpm7.2 从上游读取响应标头
Docker 安装Nginx + PHP-FPM 7.2 + Reids + Composer
Centos7编译安装nginx1.15+MariaDB10.3+php-7.2