Jump to content
View in the app

A better way to browse. Learn more.

IPBMafia.ru - поддержка Invision Community, релизы, темы, плагины и приложения

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

Всех приветствую!

Перешел с Apache на FastCGI (Nginx + PHP-FPM)
Настроил ssl в конфиге nginx, подключил http2 и отключил в админцентре mod_rewrite.
В итоге, сайт получил ощутимый прирост скорости загрузки страниц.
Но появилась проблема проблема с ссылками.
Так как .htaccess теперь не задействован, то mod_rewrite не работает.
Ссылки с поисковых систем теперь ведут прямиком в ошибку 404 nginx.
Как сделать rewrite под ngnix? 

ips 4.2.6

ngnix v 1.12.2

php 7.1.12

Сам конфиг

server {
	server_name mydomen.ru ;
	charset UTF-8;
	index index.html index.php;
	disable_symlinks if_not_owner from=$root_path;
	include /etc/nginx/vhosts-includes/*.conf;
	include /etc/nginx/vhosts-resources/mydomen.ru/*.conf;
	access_log /var/www/httpd-logs/mydomen.ru.access.log;
	error_log /var/www/httpd-logs/mydomen.ru.error.log notice;
	ssi on;
	set $root_path /var/www/koskad/data/www/mydomen.ru;
	root $root_path;
	listen 80;
	location / {
		location ~ [^/]\.ph(p\d*|tml)$ {
			try_files /does_not_exists @php;
		}
	}
	return 301 https://$host:443$request_uri;
	gzip on;
	gzip_comp_level 5;
	gzip_disable "msie6";
	gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript;
	location @php {
		fastcgi_index index.php;
		fastcgi_param PHP_ADMIN_VALUE "sendmail_path = /usr/sbin/sendmail -t -i -f admin@mydomen.ru";
		fastcgi_pass unix:/var/www/php-fpm/admin.sock;
		fastcgi_split_path_info ^((?U).+\.ph(?:p\d*|tml))(/?.+)$;
		try_files $uri =404;
		include fastcgi_params;
	}
}
server {
	server_name mydomen.ru ;
	ssl on;
	ssl_certificate "/var/www/httpd-cert/admin/mydomen.ru.crtca";
	ssl_certificate_key "/var/www/httpd-cert/admin/mydomen.ru.key";
	ssl_ciphers EECDH:+AES256:-3DES:RSA+AES:!NULL:!RC4;
	ssl_prefer_server_ciphers on;
	ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
	add_header Strict-Transport-Security "max-age=31536000;";
	ssl_dhparam /etc/ssl/certs/dhparam4096.pem;
	charset UTF-8;
	index index.html index.php;
	disable_symlinks if_not_owner from=$root_path;
	include /etc/nginx/vhosts-includes/*.conf;
	include /etc/nginx/vhosts-resources/mydomen.ru/*.conf;
	access_log /var/www/httpd-logs/mydomen.ru.access.log;
	error_log /var/www/httpd-logs/mydomen.ru.error.log notice;
	ssi on;
	set $root_path /var/www/admin/data/www/mydomen.ru;
	root $root_path;
	listen 443 ssl http2;
	gzip on;
	gzip_comp_level 5;
	gzip_disable "msie6";
	gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript;
	location / {
		location ~ [^/]\.ph(p\d*|tml)$ {
			try_files /does_not_exists @php;
		}
	}
	location @php {
		fastcgi_index index.php;
		fastcgi_param PHP_ADMIN_VALUE "sendmail_path = /usr/sbin/sendmail -t -i -f admin@mydomen.ru";
		fastcgi_pass unix:/var/www/php-fpm/admin.sock;
		fastcgi_split_path_info ^((?U).+\.ph(?:p\d*|tml))(/?.+)$;
		try_files $uri =404;
		include fastcgi_params;
	}
}

 

  • Author

Пробовал конвертировать,  не помогло.

Пробовал методом из предоставленной темы выше.

Выходит что, при клике на любую ссылку на сайте, появляется окошко на скачивание index.php.

То что я получаю после конвертации

# nginx configuration

location / {
  if (!-e $request_filename){
    rewrite \.(js|css|jpeg|jpg|gif|png|ico|map)(\?|$) /404error.php break;
  }
  if (!-e $request_filename){
    rewrite ^(.*)$ /index.php break;
  }
}

Тоже не работает

Мне нужно убрать из ссылок только /index.php?, но каким образом, понять затрудняюсь.

  • Author

Проблему решил.

Заменил 

location / {
        location ~ [^/]\.ph(p\d*|tml)$ {
            try_files /does_not_exists @php;
        }
    }

на

location / {
            try_files $uri $uri/ /index.php; 
        location ~ [^/]\.ph(p\d*|tml)$ {
            try_files /does_not_exists @php;
        }
    }

И обратно включил mod_rewrite.  

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Ответить в этой теме...

Последние посетители 0

  • No registered users viewing this page.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.