server {
root /var/www/project/public;
index index.php index.html;
server_name project.ru;
listen 443 ssl; # managed by Certbot
#laravel rewrite
location / {
try_files $uri $uri/ /index.php?$args;
}
location /robots.txt {
return 200 "User-agent: *\nDisallow: /\n";
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.1-fpm.sock;
fastcgi_param PHP_ADMIN_VALUE "error_log = /home/user/project/log/php-errors.log";
fastcgi_param PHP_VALUE date.timezone=Asia/Yekaterinburg;
fastcgi_param PHP_VALUE mbstring.func_overload=1;
fastcgi_param PHP_VALUE display_errors=On;
}
location ~ /\.ht {
deny all;
}
#логи
error_log /home/user/project/log/nginx-error.log;
access_log /home/user/project/log/nginx-access.log;
ssl_certificate /etc/letsencrypt/live/project.ru/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/project.ru/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 = project.ru) {
return 301 https://$host$request_uri;
} # managed by Certbot
server_name project.ru
listen 80;
return 404; # managed by Certbot
}
Хочу сделать меньше, чтоб эти 2 запроса объединить в 1