/etc/nginx/conf.d/site.ru.confserver {
listen 80;
listen 443 ssl;
server_name www.site.ru site.ru;
ssl_certificate /etc/letsencrypt/live/site.ru/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/site.ru/privkey.pem;
access_log /var/www/site.ru/logs/nginx-access.log;
error_log /var/www/site.ru/logs/nginx-error.log;
location / {
proxy_pass http://127.0.0.1:81;
include /etc/nginx/proxy.conf;
}
location ~* \.(jpg|jpeg|gif|png|ico|css|bmp|swf|js)$ {
root /var/www/site.ru/public;
access_log off;
expires 10d;
}
location /phpmyadmin {
root /usr/share/;
index index.php index.html index.htm;
location ~ ^/phpmyadmin/(.+\.php)$ {
try_files $uri =404;
root /usr/share/;
proxy_pass http://127.0.0.1:81;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include /etc/nginx/fastcgi_params;
}
location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
root /usr/share/;
}
}
location /phpMyAdmin {
rewrite ^/* /phpmyadmin last;
}
}