nginx conf for localhost
```
server {
listen 80;
server_name site1.ru www.site1.ru 111.111.111.22;
access_log off;
error_log off;
return 301 https://site1.ru$request_uri;
}
server {
listen 443 ssl;
server_name www.site1.ru 188.120.239.22;
ssl_certificate /etc/letsencrypt/live/site1.ru-0001/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/site1.ru-0001/privkey.pem;
access_log off;
error_log off;
return 301 https://site1.ru$request_uri;
}
server {
listen 443 ssl;
server_name site1.ru;
server_name_in_redirect off;
ssl_certificate /etc/letsencrypt/live/site1.ru-0001/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/site1.ru-0001/privkey.pem;
include /etc/letsencrypt/options-ssl-nginx.conf;
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
access_log /var/log/nginx/site1/access.log;
error_log /var/log/nginx/site1/error.log;
root /var/www/react/www;
index index.html index.php;
error_page 404 = /404;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_pass https://localhost:3000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
# Not cache
add_header Last-Modified $date_gmt;
add_header Cache-Control 'no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0';
add_header Pragma "no-cache";
if_modified_since off;
expires off;
etag off;
}
location ~* ^.+\.(jpg|jpeg|gif|png|svg|js|json|css|txt|pdf|mp3|ogg|mpe?g|avi|zip|7z|gz|bz2?|rar|ttf|otf|csv|webp|webm|woff|woff2|mp4|xlsx|xls|ai|cdr|tif|eps)$ {
access_log off;
expires max;
}
}
```
для добавление обычной пыхи php-fpm при некоторых адресах
# --- php
location ~* ^/(api|account|login|logout|registration|h7|robobill) {
#root /var/www/react/www;
try_files $uri $uri/ /index.php?$args;
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php/php8.4-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
#return 404;
}
# --- /php