Jump to content

Edit History

Prestag0od

Prestag0od

Δεν γνωρίζω ακριβώς τι πρέπει να κοιτάξω. Πρέπει να προσθέσω οτιδήποτε υπάρχει μέσα στο htaccess στο nginx; Απο ότι θυμάμαι όταν έχεις nginx κάνει bypass το htaccess και πρέπει να κάνεις οτιδήποτε μέσα απο το nginx.conf. Σωστά; Αλλά ενώ έχω επιλέξει Nginx στον server διαβάζει το htaccess και κάνει σωστά τα redirects εκτός απο την σελίδα των προϊόντων που βγάζει το error που αναφέρω πιο πάνω. Επίσης δεν ξέρω σε σχέση με gzip και άλλα που έχουν να κάνουν με την ταχύτητα τι παίζει.

To htaccess είναι αυτό

# ~~start~~ Do not remove this comment, Prestashop will keep automatically the code outside this comment when .htaccess will be generated again
# .htaccess automaticaly generated by PrestaShop e-commerce open-source solution
# http://www.prestashop.com - http://www.prestashop.com/forums

<IfModule mod_rewrite.c>
<IfModule mod_env.c>
SetEnv HTTP_MOD_REWRITE On
</IfModule>

RewriteEngine on


#Domain: mydomain.gr
RewriteRule . - [E=REWRITEBASE:/]
RewriteRule ^api(?:/(.*))?$ %{ENV:REWRITEBASE}webservice/dispatcher.php?url=$1 [QSA,L]

# Images
RewriteCond %{HTTP_HOST} ^mydomain.gr$
RewriteRule ^([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$1$2$3.jpg [L]
RewriteCond %{HTTP_HOST} ^mydomain.gr$
RewriteRule ^([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$1$2$3$4.jpg [L]
RewriteCond %{HTTP_HOST} ^mydomain.gr$
RewriteRule ^([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$1$2$3$4$5.jpg [L]
RewriteCond %{HTTP_HOST} ^mydomain.gr$
RewriteRule ^([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$1$2$3$4$5$6.jpg [L]
RewriteCond %{HTTP_HOST} ^mydomain.gr$
RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$1$2$3$4$5$6$7.jpg [L]
RewriteCond %{HTTP_HOST} ^mydomain.gr$
RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$1$2$3$4$5$6$7$8.jpg [L]
RewriteCond %{HTTP_HOST} ^mydomain.gr$
RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$7/$1$2$3$4$5$6$7$8$9.jpg [L]
RewriteCond %{HTTP_HOST} ^mydomain.gr$
RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$7/$8/$1$2$3$4$5$6$7$8$9$10.jpg [L]
RewriteCond %{HTTP_HOST} ^mydomain.gr$
RewriteRule ^c/([0-9]+)(\-[\.*_a-zA-Z0-9-]*)(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/c/$1$2$3.jpg [L]
RewriteCond %{HTTP_HOST} ^mydomain.gr$
RewriteRule ^c/([a-zA-Z_-]+)(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/c/$1$2.jpg [L]
# AlphaImageLoader for IE and fancybox
RewriteRule ^images_ie/?([^/]+)\.(jpe?g|png|gif)$ js/jquery/plugins/fancybox/images/$1.$2 [L]

# Dispatcher
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ %{ENV:REWRITEBASE}index.php [NC,L]
</IfModule>

AddType application/vnd.ms-fontobject .eot
AddType font/ttf .ttf
AddType font/otf .otf
AddType application/font-woff .woff
AddType font/woff2 .woff2
<IfModule mod_headers.c>
	<FilesMatch "\.(ttf|ttc|otf|eot|woff|woff2|svg)$">
		Header set Access-Control-Allow-Origin "*"
	</FilesMatch>

    <FilesMatch "\.pdf$">
      Header set Content-Disposition "Attachment"
      Header set X-Content-Type-Options "nosniff"
    </FilesMatch>
</IfModule>

<Files composer.lock>
    # Apache 2.2
    <IfModule !mod_authz_core.c>
        Order deny,allow
        Deny from all
    </IfModule>

    # Apache 2.4
    <IfModule mod_authz_core.c>
        Require all denied
    </IfModule>
</Files>
#If rewrite mod isn't enabled
ErrorDocument 404 /index.php?controller=404

# ~~end~~ Do not remove this comment, Prestashop will keep automatically the code outside this comment when .htaccess will be generated again

και το nginx
 

#ATTENTION!
#
#DO NOT MODIFY THIS FILE BECAUSE IT WAS GENERATED AUTOMATICALLY,
#SO ALL YOUR CHANGES WILL BE LOST THE NEXT TIME THE FILE IS GENERATED.

server {
	listen 3.136.69.71:443 ssl http2;

	server_name mydomain.gr;
	server_name www.mydomain.gr;
	server_name ipv4.mydomain.gr;

	ssl_certificate             /usr/local/psa/var/certificates/scfbR0RZx;
	ssl_certificate_key         /usr/local/psa/var/certificates/scfbR0RZx;

	client_max_body_size 128m;

	# mailconfig
	location ~* ^/autodiscover/autodiscover\.xml$ {
		try_files $uri @mad;
	}
	location ~* ^(/\.well-known/autoconfig)?/mail/config\-v1\.1\.xml$ {
		try_files $uri @mad;
	}

	location  ~* ^/email\.mobileconfig$ {
		try_files $uri @mad;
	}

	location @mad {
		rewrite ^(.*)$ /mailconfig/ break;

		proxy_pass                          http://127.0.0.1:8880;
		proxy_set_header X-Host             $host;
		proxy_set_header X-Request-URI      $request_uri;
	}
	# mailconfig

	root "/var/www/vhosts/mydomain.gr/httpdocs";
	access_log "/var/www/vhosts/system/mydomain.gr/logs/proxy_access_ssl_log";
	error_log "/var/www/vhosts/system/mydomain.gr/logs/proxy_error_log";

	#extension letsencrypt begin
	location ^~ /.well-known/acme-challenge/ {
		root /var/www/vhosts/default/htdocs;

		types { }
		default_type text/plain;

		satisfy any;
		auth_basic off;
		allow all;

		location ~ ^/\.well-known/acme-challenge.*/\. {
			deny all;
		}
	}
	#extension letsencrypt end

	#extension sslit begin

	#OCSP Stapling
	ssl_stapling on;
	ssl_stapling_verify on;

	#extension sslit end

	error_page 400 "/error_docs/bad_request.html";
	error_page 401 "/error_docs/unauthorized.html";
	error_page 403 "/error_docs/forbidden.html";
	error_page 404 "/error_docs/not_found.html";
	error_page 500 "/error_docs/internal_server_error.html";
	error_page 405 "/error_docs/method_not_allowed.html";
	error_page 406 "/error_docs/not_acceptable.html";
	error_page 407 "/error_docs/proxy_authentication_required.html";
	error_page 412 "/error_docs/precondition_failed.html";
	error_page 414 "/error_docs/request_uri_too_long.html";
	error_page 415 "/error_docs/unsupported_media_type.html";
	error_page 501 "/error_docs/not_implemented.html";
	error_page 502 "/error_docs/bad_gateway.html";
	error_page 503 "/error_docs/maintenance.html";

	location ^~ /error_docs {
		root "/var/www/vhosts/mydomain.gr";
	}

	location / {
		proxy_pass https://3.136.69.71:7081;
		proxy_hide_header upgrade;
		proxy_set_header Host             $host;
		proxy_set_header X-Real-IP        $remote_addr;
		proxy_set_header X-Forwarded-For  $proxy_add_x_forwarded_for;
		proxy_set_header X-Accel-Internal /internal-nginx-static-location;
		access_log off;

	}

	location /internal-nginx-static-location/ {
		alias /var/www/vhosts/mydomain.gr/httpdocs/;
		internal;
	}

	location ~ ^/(plesk-stat|awstats-icon|webstat|webstat-ssl|ftpstat|anon_ftpstat) {
		proxy_pass https://3.136.69.71:7081;
		proxy_hide_header upgrade;
		proxy_set_header Host             $host;
		proxy_set_header X-Real-IP        $remote_addr;
		proxy_set_header X-Forwarded-For  $proxy_add_x_forwarded_for;
		proxy_set_header X-Accel-Internal /internal-nginx-static-location;
		access_log off;

	}

	location ~ ^/~(.+?)(/.*?\.php)(/.*)?$ {
		alias /var/www/vhosts/mydomain.gr/web_users/$1/$2;
		fastcgi_split_path_info ^((?U).+\.php)(/?.+)$;
		try_files $uri $fastcgi_script_name =404;
		fastcgi_param PATH_INFO $fastcgi_path_info;
		fastcgi_pass "unix:/var/www/vhosts/system/mydomain.gr/php-fpm.sock";
		include /etc/nginx/fastcgi.conf;

	}

	location ~ ^/~(.+?)(/.*)?$ {
		proxy_pass https://3.136.69.71:7081;
		proxy_hide_header upgrade;
		proxy_set_header Host             $host;
		proxy_set_header X-Real-IP        $remote_addr;
		proxy_set_header X-Forwarded-For  $proxy_add_x_forwarded_for;
		proxy_set_header X-Accel-Internal /internal-nginx-static-location;
		access_log off;

	}

	location ~ \.php(/.*)?$ {
		fastcgi_split_path_info ^((?U).+\.php)(/?.+)$;
		try_files $uri $fastcgi_script_name =404;
		fastcgi_param PATH_INFO $fastcgi_path_info;
		fastcgi_pass "unix:/var/www/vhosts/system/mydomain.gr/php-fpm.sock";
		include /etc/nginx/fastcgi.conf;

	}

	add_header X-Powered-By PleskLin;

	include "/var/www/vhosts/system/mydomain.gr/conf/vhost_nginx.conf";
}

server {
	listen 213.136.69.71:80;

	server_name mydomain.gr;
	server_name www.mydomain.gr;
	server_name ipv4.mydomain.gr;

	client_max_body_size 128m;

	# mailconfig
	location ~* ^/autodiscover/autodiscover\.xml$ {
		try_files $uri @mad;
	}
	location ~* ^(/\.well-known/autoconfig)?/mail/config\-v1\.1\.xml$ {
		try_files $uri @mad;
	}

	location  ~* ^/email\.mobileconfig$ {
		try_files $uri @mad;
	}

	location @mad {
		rewrite ^(.*)$ /mailconfig/ break;

		proxy_pass                          http://127.0.0.1:8880;
		proxy_set_header X-Host             $host;
		proxy_set_header X-Request-URI      $request_uri;
	}
	# mailconfig

	location / {
		return 301 https://$host$request_uri;
	}
}

 

Prestag0od

Prestag0od

Δεν γνωρίζω ακριβώς τι πρέπει να κοιτάξω. Πρέπει να προσθέσω οτιδήποτε υπάρχει μέσα στο htaccess στο nginx; Απο ότι θυμάμαι όταν έχεις nginx κάνει bypass το htaccess και πρέπει να κάνεις οτιδήποτε μέσα απο το nginx.conf. Σωστά; Αλλά ενώ έχω επιλέξει Nginx στον server διαβάζει το htaccess και κάνει σωστά τα redirects εκτός απο την σελίδα των προϊόντων που βγάζει το error που αναφέρω πιο πάνω. Επίσης δεν ξέρω σε σχέση με gzip και άλλα που έχουν να κάνουν με την ταχύτητα τι παίζει.

To htaccess είναι αυτό

# ~~start~~ Do not remove this comment, Prestashop will keep automatically the code outside this comment when .htaccess will be generated again
# .htaccess automaticaly generated by PrestaShop e-commerce open-source solution
# http://www.prestashop.com - http://www.prestashop.com/forums

<IfModule mod_rewrite.c>
<IfModule mod_env.c>
SetEnv HTTP_MOD_REWRITE On
</IfModule>

RewriteEngine on


#Domain: mydomain.gr
RewriteRule . - [E=REWRITEBASE:/]
RewriteRule ^api(?:/(.*))?$ %{ENV:REWRITEBASE}webservice/dispatcher.php?url=$1 [QSA,L]

# Images
RewriteCond %{HTTP_HOST} ^mydomain.gr$
RewriteRule ^([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$1$2$3.jpg [L]
RewriteCond %{HTTP_HOST} ^mydomain.gr$
RewriteRule ^([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$1$2$3$4.jpg [L]
RewriteCond %{HTTP_HOST} ^mydomain.gr$
RewriteRule ^([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$1$2$3$4$5.jpg [L]
RewriteCond %{HTTP_HOST} ^mydomain.gr$
RewriteRule ^([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$1$2$3$4$5$6.jpg [L]
RewriteCond %{HTTP_HOST} ^mydomain.gr$
RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$1$2$3$4$5$6$7.jpg [L]
RewriteCond %{HTTP_HOST} ^mydomain.gr$
RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$1$2$3$4$5$6$7$8.jpg [L]
RewriteCond %{HTTP_HOST} ^mydomain.gr$
RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$7/$1$2$3$4$5$6$7$8$9.jpg [L]
RewriteCond %{HTTP_HOST} ^mydomain.gr$
RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$7/$8/$1$2$3$4$5$6$7$8$9$10.jpg [L]
RewriteCond %{HTTP_HOST} ^mydomain.gr$
RewriteRule ^c/([0-9]+)(\-[\.*_a-zA-Z0-9-]*)(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/c/$1$2$3.jpg [L]
RewriteCond %{HTTP_HOST} ^mydomain.gr$
RewriteRule ^c/([a-zA-Z_-]+)(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/c/$1$2.jpg [L]
# AlphaImageLoader for IE and fancybox
RewriteRule ^images_ie/?([^/]+)\.(jpe?g|png|gif)$ js/jquery/plugins/fancybox/images/$1.$2 [L]

# Dispatcher
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ %{ENV:REWRITEBASE}index.php [NC,L]
</IfModule>

AddType application/vnd.ms-fontobject .eot
AddType font/ttf .ttf
AddType font/otf .otf
AddType application/font-woff .woff
AddType font/woff2 .woff2
<IfModule mod_headers.c>
	<FilesMatch "\.(ttf|ttc|otf|eot|woff|woff2|svg)$">
		Header set Access-Control-Allow-Origin "*"
	</FilesMatch>

    <FilesMatch "\.pdf$">
      Header set Content-Disposition "Attachment"
      Header set X-Content-Type-Options "nosniff"
    </FilesMatch>
</IfModule>

<Files composer.lock>
    # Apache 2.2
    <IfModule !mod_authz_core.c>
        Order deny,allow
        Deny from all
    </IfModule>

    # Apache 2.4
    <IfModule mod_authz_core.c>
        Require all denied
    </IfModule>
</Files>
#If rewrite mod isn't enabled
ErrorDocument 404 /index.php?controller=404

# ~~end~~ Do not remove this comment, Prestashop will keep automatically the code outside this comment when .htaccess will be generated again

και το nginx
 

#ATTENTION!
#
#DO NOT MODIFY THIS FILE BECAUSE IT WAS GENERATED AUTOMATICALLY,
#SO ALL YOUR CHANGES WILL BE LOST THE NEXT TIME THE FILE IS GENERATED.

server {
	listen 213.136.69.71:443 ssl http2;

	server_name mydomain.gr;
	server_name www.mydomain.gr;
	server_name ipv4.mydomain.gr;

	ssl_certificate             /usr/local/psa/var/certificates/scfbR0RZx;
	ssl_certificate_key         /usr/local/psa/var/certificates/scfbR0RZx;

	client_max_body_size 128m;

	# mailconfig
	location ~* ^/autodiscover/autodiscover\.xml$ {
		try_files $uri @mad;
	}
	location ~* ^(/\.well-known/autoconfig)?/mail/config\-v1\.1\.xml$ {
		try_files $uri @mad;
	}

	location  ~* ^/email\.mobileconfig$ {
		try_files $uri @mad;
	}

	location @mad {
		rewrite ^(.*)$ /mailconfig/ break;

		proxy_pass                          http://127.0.0.1:8880;
		proxy_set_header X-Host             $host;
		proxy_set_header X-Request-URI      $request_uri;
	}
	# mailconfig

	root "/var/www/vhosts/mydomain.gr/httpdocs";
	access_log "/var/www/vhosts/system/mydomain.gr/logs/proxy_access_ssl_log";
	error_log "/var/www/vhosts/system/mydomain.gr/logs/proxy_error_log";

	#extension letsencrypt begin
	location ^~ /.well-known/acme-challenge/ {
		root /var/www/vhosts/default/htdocs;

		types { }
		default_type text/plain;

		satisfy any;
		auth_basic off;
		allow all;

		location ~ ^/\.well-known/acme-challenge.*/\. {
			deny all;
		}
	}
	#extension letsencrypt end

	#extension sslit begin

	#OCSP Stapling
	ssl_stapling on;
	ssl_stapling_verify on;

	#extension sslit end

	error_page 400 "/error_docs/bad_request.html";
	error_page 401 "/error_docs/unauthorized.html";
	error_page 403 "/error_docs/forbidden.html";
	error_page 404 "/error_docs/not_found.html";
	error_page 500 "/error_docs/internal_server_error.html";
	error_page 405 "/error_docs/method_not_allowed.html";
	error_page 406 "/error_docs/not_acceptable.html";
	error_page 407 "/error_docs/proxy_authentication_required.html";
	error_page 412 "/error_docs/precondition_failed.html";
	error_page 414 "/error_docs/request_uri_too_long.html";
	error_page 415 "/error_docs/unsupported_media_type.html";
	error_page 501 "/error_docs/not_implemented.html";
	error_page 502 "/error_docs/bad_gateway.html";
	error_page 503 "/error_docs/maintenance.html";

	location ^~ /error_docs {
		root "/var/www/vhosts/mydomain.gr";
	}

	location / {
		proxy_pass https://213.136.69.71:7081;
		proxy_hide_header upgrade;
		proxy_set_header Host             $host;
		proxy_set_header X-Real-IP        $remote_addr;
		proxy_set_header X-Forwarded-For  $proxy_add_x_forwarded_for;
		proxy_set_header X-Accel-Internal /internal-nginx-static-location;
		access_log off;

	}

	location /internal-nginx-static-location/ {
		alias /var/www/vhosts/mydomain.gr/httpdocs/;
		internal;
	}

	location ~ ^/(plesk-stat|awstats-icon|webstat|webstat-ssl|ftpstat|anon_ftpstat) {
		proxy_pass https://3.136.69.71:7081;
		proxy_hide_header upgrade;
		proxy_set_header Host             $host;
		proxy_set_header X-Real-IP        $remote_addr;
		proxy_set_header X-Forwarded-For  $proxy_add_x_forwarded_for;
		proxy_set_header X-Accel-Internal /internal-nginx-static-location;
		access_log off;

	}

	location ~ ^/~(.+?)(/.*?\.php)(/.*)?$ {
		alias /var/www/vhosts/mydomain.gr/web_users/$1/$2;
		fastcgi_split_path_info ^((?U).+\.php)(/?.+)$;
		try_files $uri $fastcgi_script_name =404;
		fastcgi_param PATH_INFO $fastcgi_path_info;
		fastcgi_pass "unix:/var/www/vhosts/system/mydomain.gr/php-fpm.sock";
		include /etc/nginx/fastcgi.conf;

	}

	location ~ ^/~(.+?)(/.*)?$ {
		proxy_pass https://3.136.69.71:7081;
		proxy_hide_header upgrade;
		proxy_set_header Host             $host;
		proxy_set_header X-Real-IP        $remote_addr;
		proxy_set_header X-Forwarded-For  $proxy_add_x_forwarded_for;
		proxy_set_header X-Accel-Internal /internal-nginx-static-location;
		access_log off;

	}

	location ~ \.php(/.*)?$ {
		fastcgi_split_path_info ^((?U).+\.php)(/?.+)$;
		try_files $uri $fastcgi_script_name =404;
		fastcgi_param PATH_INFO $fastcgi_path_info;
		fastcgi_pass "unix:/var/www/vhosts/system/mydomain.gr/php-fpm.sock";
		include /etc/nginx/fastcgi.conf;

	}

	add_header X-Powered-By PleskLin;

	include "/var/www/vhosts/system/mydomain.gr/conf/vhost_nginx.conf";
}

server {
	listen 213.136.69.71:80;

	server_name mydomain.gr;
	server_name www.mydomain.gr;
	server_name ipv4.mydomain.gr;

	client_max_body_size 128m;

	# mailconfig
	location ~* ^/autodiscover/autodiscover\.xml$ {
		try_files $uri @mad;
	}
	location ~* ^(/\.well-known/autoconfig)?/mail/config\-v1\.1\.xml$ {
		try_files $uri @mad;
	}

	location  ~* ^/email\.mobileconfig$ {
		try_files $uri @mad;
	}

	location @mad {
		rewrite ^(.*)$ /mailconfig/ break;

		proxy_pass                          http://127.0.0.1:8880;
		proxy_set_header X-Host             $host;
		proxy_set_header X-Request-URI      $request_uri;
	}
	# mailconfig

	location / {
		return 301 https://$host$request_uri;
	}
}

 

Prestag0od

Prestag0od

Δεν γνωρίζω ακριβώς τι πρέπει να κοιτάξω. Πρέπει να προσθέσω οτιδήποτε υπάρχει μέσα στο htaccess στο nginx; Απο ότι θυμάμαι όταν έχεις nginx κάνει bypass το htaccess και πρέπει να κάνεις οτιδήποτε μέσα απο το nginx.conf. Σωστά; Αλλά ενώ έχω επιλέξει Nginx στον server διαβάζει το htaccess και κάνει σωστά τα redirects εκτός απο την σελίδα των προϊόντων που βγάζει το error που αναφέρω πιο πάνω. Επίσης δεν ξέρω σε σχέση με gzip και άλλα που έχουν να κάνουν με την ταχύτητα τι παίζει.

To htaccess είναι αυτό

# ~~start~~ Do not remove this comment, Prestashop will keep automatically the code outside this comment when .htaccess will be generated again
# .htaccess automaticaly generated by PrestaShop e-commerce open-source solution
# http://www.prestashop.com - http://www.prestashop.com/forums

<IfModule mod_rewrite.c>
<IfModule mod_env.c>
SetEnv HTTP_MOD_REWRITE On
</IfModule>

RewriteEngine on


#Domain: mydomain.gr
RewriteRule . - [E=REWRITEBASE:/]
RewriteRule ^api(?:/(.*))?$ %{ENV:REWRITEBASE}webservice/dispatcher.php?url=$1 [QSA,L]

# Images
RewriteCond %{HTTP_HOST} ^mydomain.gr$
RewriteRule ^([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$1$2$3.jpg [L]
RewriteCond %{HTTP_HOST} ^mydomain.gr$
RewriteRule ^([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$1$2$3$4.jpg [L]
RewriteCond %{HTTP_HOST} ^mydomain.gr$
RewriteRule ^([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$1$2$3$4$5.jpg [L]
RewriteCond %{HTTP_HOST} ^mydomain.gr$
RewriteRule ^([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$1$2$3$4$5$6.jpg [L]
RewriteCond %{HTTP_HOST} ^mydomain.gr$
RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$1$2$3$4$5$6$7.jpg [L]
RewriteCond %{HTTP_HOST} ^mydomain.gr$
RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$1$2$3$4$5$6$7$8.jpg [L]
RewriteCond %{HTTP_HOST} ^mydomain.gr$
RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$7/$1$2$3$4$5$6$7$8$9.jpg [L]
RewriteCond %{HTTP_HOST} ^mydomain.gr$
RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$7/$8/$1$2$3$4$5$6$7$8$9$10.jpg [L]
RewriteCond %{HTTP_HOST} ^mydomain.gr$
RewriteRule ^c/([0-9]+)(\-[\.*_a-zA-Z0-9-]*)(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/c/$1$2$3.jpg [L]
RewriteCond %{HTTP_HOST} ^mydomain.gr$
RewriteRule ^c/([a-zA-Z_-]+)(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/c/$1$2.jpg [L]
# AlphaImageLoader for IE and fancybox
RewriteRule ^images_ie/?([^/]+)\.(jpe?g|png|gif)$ js/jquery/plugins/fancybox/images/$1.$2 [L]

# Dispatcher
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ %{ENV:REWRITEBASE}index.php [NC,L]
</IfModule>

AddType application/vnd.ms-fontobject .eot
AddType font/ttf .ttf
AddType font/otf .otf
AddType application/font-woff .woff
AddType font/woff2 .woff2
<IfModule mod_headers.c>
	<FilesMatch "\.(ttf|ttc|otf|eot|woff|woff2|svg)$">
		Header set Access-Control-Allow-Origin "*"
	</FilesMatch>

    <FilesMatch "\.pdf$">
      Header set Content-Disposition "Attachment"
      Header set X-Content-Type-Options "nosniff"
    </FilesMatch>
</IfModule>

<Files composer.lock>
    # Apache 2.2
    <IfModule !mod_authz_core.c>
        Order deny,allow
        Deny from all
    </IfModule>

    # Apache 2.4
    <IfModule mod_authz_core.c>
        Require all denied
    </IfModule>
</Files>
#If rewrite mod isn't enabled
ErrorDocument 404 /index.php?controller=404

# ~~end~~ Do not remove this comment, Prestashop will keep automatically the code outside this comment when .htaccess will be generated again

και το nginx
 

#ATTENTION!
#
#DO NOT MODIFY THIS FILE BECAUSE IT WAS GENERATED AUTOMATICALLY,
#SO ALL YOUR CHANGES WILL BE LOST THE NEXT TIME THE FILE IS GENERATED.

server {
	listen 213.136.69.71:443 ssl http2;

	server_name mydomain.gr;
	server_name www.mydomain.gr;
	server_name ipv4.mydomain.gr;

	ssl_certificate             /usr/local/psa/var/certificates/scfbR0RZx;
	ssl_certificate_key         /usr/local/psa/var/certificates/scfbR0RZx;

	client_max_body_size 128m;

	# mailconfig
	location ~* ^/autodiscover/autodiscover\.xml$ {
		try_files $uri @mad;
	}
	location ~* ^(/\.well-known/autoconfig)?/mail/config\-v1\.1\.xml$ {
		try_files $uri @mad;
	}

	location  ~* ^/email\.mobileconfig$ {
		try_files $uri @mad;
	}

	location @mad {
		rewrite ^(.*)$ /mailconfig/ break;

		proxy_pass                          http://127.0.0.1:8880;
		proxy_set_header X-Host             $host;
		proxy_set_header X-Request-URI      $request_uri;
	}
	# mailconfig

	root "/var/www/vhosts/mydomain.gr/httpdocs";
	access_log "/var/www/vhosts/system/mydomain.gr/logs/proxy_access_ssl_log";
	error_log "/var/www/vhosts/system/mydomain.gr/logs/proxy_error_log";

	#extension letsencrypt begin
	location ^~ /.well-known/acme-challenge/ {
		root /var/www/vhosts/default/htdocs;

		types { }
		default_type text/plain;

		satisfy any;
		auth_basic off;
		allow all;

		location ~ ^/\.well-known/acme-challenge.*/\. {
			deny all;
		}
	}
	#extension letsencrypt end

	#extension sslit begin

	#OCSP Stapling
	ssl_stapling on;
	ssl_stapling_verify on;

	#extension sslit end

	error_page 400 "/error_docs/bad_request.html";
	error_page 401 "/error_docs/unauthorized.html";
	error_page 403 "/error_docs/forbidden.html";
	error_page 404 "/error_docs/not_found.html";
	error_page 500 "/error_docs/internal_server_error.html";
	error_page 405 "/error_docs/method_not_allowed.html";
	error_page 406 "/error_docs/not_acceptable.html";
	error_page 407 "/error_docs/proxy_authentication_required.html";
	error_page 412 "/error_docs/precondition_failed.html";
	error_page 414 "/error_docs/request_uri_too_long.html";
	error_page 415 "/error_docs/unsupported_media_type.html";
	error_page 501 "/error_docs/not_implemented.html";
	error_page 502 "/error_docs/bad_gateway.html";
	error_page 503 "/error_docs/maintenance.html";

	location ^~ /error_docs {
		root "/var/www/vhosts/mydomain.gr";
	}

	location / {
		proxy_pass https://213.136.69.71:7081;
		proxy_hide_header upgrade;
		proxy_set_header Host             $host;
		proxy_set_header X-Real-IP        $remote_addr;
		proxy_set_header X-Forwarded-For  $proxy_add_x_forwarded_for;
		proxy_set_header X-Accel-Internal /internal-nginx-static-location;
		access_log off;

	}

	location /internal-nginx-static-location/ {
		alias /var/www/vhosts/mydomain.gr/httpdocs/;
		internal;
	}

	location ~ ^/(plesk-stat|awstats-icon|webstat|webstat-ssl|ftpstat|anon_ftpstat) {
		proxy_pass https://213.136.69.71:7081;
		proxy_hide_header upgrade;
		proxy_set_header Host             $host;
		proxy_set_header X-Real-IP        $remote_addr;
		proxy_set_header X-Forwarded-For  $proxy_add_x_forwarded_for;
		proxy_set_header X-Accel-Internal /internal-nginx-static-location;
		access_log off;

	}

	location ~ ^/~(.+?)(/.*?\.php)(/.*)?$ {
		alias /var/www/vhosts/mydomain.gr/web_users/$1/$2;
		fastcgi_split_path_info ^((?U).+\.php)(/?.+)$;
		try_files $uri $fastcgi_script_name =404;
		fastcgi_param PATH_INFO $fastcgi_path_info;
		fastcgi_pass "unix:/var/www/vhosts/system/mydomain.gr/php-fpm.sock";
		include /etc/nginx/fastcgi.conf;

	}

	location ~ ^/~(.+?)(/.*)?$ {
		proxy_pass https://213.136.69.71:7081;
		proxy_hide_header upgrade;
		proxy_set_header Host             $host;
		proxy_set_header X-Real-IP        $remote_addr;
		proxy_set_header X-Forwarded-For  $proxy_add_x_forwarded_for;
		proxy_set_header X-Accel-Internal /internal-nginx-static-location;
		access_log off;

	}

	location ~ \.php(/.*)?$ {
		fastcgi_split_path_info ^((?U).+\.php)(/?.+)$;
		try_files $uri $fastcgi_script_name =404;
		fastcgi_param PATH_INFO $fastcgi_path_info;
		fastcgi_pass "unix:/var/www/vhosts/system/mydomain.gr/php-fpm.sock";
		include /etc/nginx/fastcgi.conf;

	}

	add_header X-Powered-By PleskLin;

	include "/var/www/vhosts/system/mydomain.gr/conf/vhost_nginx.conf";
}

server {
	listen 213.136.69.71:80;

	server_name mydomain.gr;
	server_name www.mydomain.gr;
	server_name ipv4.mydomain.gr;

	client_max_body_size 128m;

	# mailconfig
	location ~* ^/autodiscover/autodiscover\.xml$ {
		try_files $uri @mad;
	}
	location ~* ^(/\.well-known/autoconfig)?/mail/config\-v1\.1\.xml$ {
		try_files $uri @mad;
	}

	location  ~* ^/email\.mobileconfig$ {
		try_files $uri @mad;
	}

	location @mad {
		rewrite ^(.*)$ /mailconfig/ break;

		proxy_pass                          http://127.0.0.1:8880;
		proxy_set_header X-Host             $host;
		proxy_set_header X-Request-URI      $request_uri;
	}
	# mailconfig

	location / {
		return 301 https://$host$request_uri;
	}
}

 

×
×
  • Create New...