# www -> ssl non www
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ https://%1/$1 [R=301,L]
# non ssl -> ssl
RewriteCond %{HTTPS} off
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteCond %{THE_REQUEST} //
RewriteRule .* /$0 [R=301,L]
RewriteCond %{THE_REQUEST} ^[^?]+//
RewriteRule .* https://site.ru/$0 [R=301,L]
# SEO URL Settings
RewriteEngine On
RewriteCond %{THE_REQUEST} ^[^?]+//
RewriteRule .* https://site.ru/$0 [R=301,L]
RewriteCond %{QUERY_STRING} &product_id=2548(&|$)
RewriteRule ^(.*)$ https://site.ru/ryukzaki/gorodskie-ryukzaki/ryukzak-hedgard-4350-kofe? [L,R=301]
# www -> ssl non www
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ https://%1/$1 [R=301,L]
# non ssl -> ssl
RewriteCond %{HTTPS} off
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
#-----
# RewriteCond %{QUERY_STRING} (^|&)route\=extension/feed/google_sitemap($|&)
# RewriteRule ^index\.php$ /map.xml? [L,R=301]
RewriteBase /
RewriteRule ^sitemap.xml$ index.php?route=feed/google_sitemap [L]
RewriteRule ^googlebase.xml$ index.php?route=feed/google_base [L]
RewriteRule ^download/(.*) /index.php?route=error/not_found [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !.*\.(ico|gif|jpg|jpeg|png|js|css)
RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]
RewriteRule ^(?!cat$)([^/.]+)$ http://site.ru/cat/$1 [R=301,L]
String path="\\\\home\\book\\magazine\\out";
String path2="\\\\home\\book\\magazine";
if( path.startsWith(path2)
&& path.length() == path2.length()
|| path.startsWith("\\", path2.length())
){
System.out.println("find");
}
"\n"
символ новой строки"\t"
табуляция"\b"
backspace возврат на один символSystem.out.println("\\");
System.out.println("\\\\home\\book_store\\magazine");
\
тоже имеет специальное значение и его снова нужно удвоить. Так что в итоге String path="\\\\home\\book\\magazine";
String pattern="\\\\\\\\home\\\\book\\\\magazine(|\\\\.*)";
import java.util.regex.Pattern;
String path="\\\\home\\book\\magazine";
String pattern="\\\\home\\book\\magazine";
pattern = Pattern.quote(pattern).concat("(|\\\\.*)");
server {
listen 80;
listen [::]:80;
root /var/www/mysite/public;
index index.php index.html;
server_name mysite.ru;
location / {
try_files $uri /index.php$is_args$args;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.3-fpm.sock;
}
}
server {
listen 80;
listen [::]:80;
root /var/www/mysite/public;
index index.php index.html;
server_name api.mysite.ru;
location / {
try_files $uri /index.php?$args;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.3-fpm.sock;
fastcgi_param REQUEST_URI /api$request_uri;
fastcgi_param HTTP_HOST mysite.ru;
}
}
server {
listen 80;
listen [::]:80;
root /var/www/mysite/public;
index index.php index.html;
server_name mysite.ru;
location / {
try_files $uri /index.php$is_args$args;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.3-fpm.sock;
}
}
server {
listen 80;
listen [::]:80;
server_name api.mysite.ru;
location / {
proxy_pass http://127.0.0.1/api/;
proxy_set_header Host mysite.ru;
}
}
Скорее всего из каталога conf.d как-то так:
include /etc/nginx/conf.d/*.conf;
Останется добавить в каталог conf.d файл с настройками для 80 порта.