Answer the question
In order to leave comments, you need to log in
Setting up nginx http to https redirect?
server {
server_name 123.com www.123.com;
add_header X-Frame-Options "SAMEORIGIN";
add_header X-XSS-Protection "1; mode=block";
add_header X-Content-Type-Options "nosniff";
charset off;
index index.php index.html;
disable_symlinks if_not_owner from=$root_path;
include /etc/nginx/vhosts-includes/*.conf;
include /etc/nginx/vhosts-resources/123.com/*.conf;
access_log /var/www/httpd-logs/123.com.access.log;
error_log /var/www/httpd-logs/123.com.error.log notice;
return 301 https://$host:443$request_uri;
set $root_path /var/www/www-root/data/www/123.com/public;
root $root_path;
listen 123.123.123.123:80 default_server;
error_page 404 /index.php;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $root_path$fastcgi_script_name;
fastcgi_pass unix:/var/www/php-fpm/www-root.sock;
include fastcgi_params;
}
}
Answer the question
In order to leave comments, you need to log in
server {
listen 123.123.123.123:80 default_server;
server_name 123.com www.123.com;
add_header X-Frame-Options "SAMEORIGIN";
add_header X-XSS-Protection "1; mode=block";
add_header X-Content-Type-Options "nosniff";
charset off;
index index.php index.html;
set $root_path /var/www/www-root/data/www/123.com/public;
root $root_path;
disable_symlinks if_not_owner from=$root_path;
access_log /var/www/httpd-logs/123.com.access.log;
error_log /var/www/httpd-logs/123.com.error.log notice;
error_page 404 /index.php;
location / {
return 301 https://$host$request_uri;
}
location ~ ^/(bouns)?$ {
fastcgi_param SCRIPT_FILENAME $root_path/index.php;
fastcgi_pass unix:/var/www/php-fpm/www-root.sock;
include fastcgi_params;
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question