Merhaba,
Uzun zamandır NGINX ve laraveli birlikte kullanmama rağmen bir türlü webmaster tool'larda düzelmeyen bir sorunum var. NGINX 301 redirect yapmama rağmen arama
motorları redirectleri düzgün göstermiyor. Sarı ünlemli uyarılar veriyor. Aşağıda ayarlarım var neyi düzeltmem gerekiyor acaba
server {
# Force non-www version of the site
listen 80;
server_name sirtcantalilar.com www.sirtcantalilar.com;
return 301 https://sirtcantalilar.com$request_uri;
}
server {
#listen 80;
listen 443 ssl;
server_name sirtcantalilar.com www.sirtcantalilar.com;
#access_log /var/log/nginx/sirtcantalilar.com/access.log;
#error_log /var/log/nginx/sirtcantalilar.com/error.log;
rewrite_log on;
#access_log logs/host.access.log main;
root /home/ytsejam/public/sirtcantalilar.com/public/;
charset utf-8;
ssl on;
ssl_certificate /etc/nginx/ssl/unified.crt;
ssl_certificate_key /etc/nginx/ssl/thismoment.key;
ssl_certificate /etc/nginx/ssl/unified.crt;
ssl_certificate_key /etc/nginx/ssl/thismoment.key;
ssl_session_timeout 1m;
add_header Strict-Transport-Security max-age=18144000;
#add_header X-Frame-Options DENY;
ssl_protocols SSLv2 SSLv3 TLSv1;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;
keepalive_timeout 70;
autoindex on;
# Point index to the Laravel front controller.
index index.php;
location / {
# URLs to attempt, including pretty ones.
try_files $uri $uri/ /index.php?$query_string;
}
# Remove trailing slash to please routing system.
if (!-d $request_filename) {
rewrite ^/(.+)/$ /$1 permanent;
}
if ($host = 'www.sirtcantalilar.com') {
rewrite ^/(.*)$ https://sirtcantalilar.com/$1 permanent;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
# Remove trailing slash to please routing system.
if (!-d $request_filename) {
rewrite ^/(.+)/$ /$1 permanent;
}
if ($host = 'www.sirtcantalilar.com') {
rewrite ^/(.*)$ https://sirtcantalilar.com/$1 permanent;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
# PHP FPM configuration.
location ~* \.php$ {
fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
fastcgi_index index.php;
fastcgi_split_path_info ^(.+\.php)(.*)$;
include /etc/nginx/fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
# We don't need .ht files with nginx.
location ~ /\.ht {
deny all;
}
location ~ /\.(eot|otf|ttf|woff)$ {
add_header Access-Control-Allow-Origin *;
}
location ~* \.php$ {
expires -1;
}
}
# Set header expirations on per-project basis
location ~* ^.+\.(?:ico|css|js|gif|jpe?g|JPE?G|png|svg|woff|eot|tff)(\?ver=[0-9.]+)?$ {
#root /home/ytsejam/public/sirtcantalilar.com/public;
expires max;
#expires 1m;
#tcp_nodelay off; ## Set the OS file cache.
#open_file_cache max=100 inactive=120s;
#open_file_cache_valid 45s;
#open_file_cache_min_uses 2;
#open_file_cache_errors off;
add_header Pragma public;
add_header Cache-Control public;
log_not_found off;
access_log off;
}
location ~* \.(?:ttf|ttc|otf|eot|woff|font.css)$ {
add_header "Access-Control-Allow-Origin" "*";
expires 365d;
access_log off;
add_header Cache-Control "public";
}
}
Teşekkürler