Home CentOS7 nginx gscreen.conf 완벽 설정

nginx gscreen.conf 완벽 설정

by maxblog
0 comment
server {

	listen       80;
	server_name gscreen.net www.gscreen.net;
	return 301 https://$host$request_uri;
}




server {

	listen       443 ssl;
	server_name gscreen.net www.gscreen.net;

	ssl_certificate /etc/letsencrypt/live/gscreen.net/fullchain.pem;
	ssl_certificate_key /etc/letsencrypt/live/gscreen.net/privkey.pem; 

	root   /maxwww/gscreen.net;
	index index.php index.html index.htm;

	try_files $uri $uri/ /index.php?$query_string;
# 	try_files $uri $uri/ /index.php$is_args$args;	
    
	location ~ /wp-content/(?<path>.+)\.(?<ext>jpe?g|png|gif)$ {
        if ($http_accept !~* "image/webp") {
            break;
	}
	add_header Vary Accept;
	add_header Cache-Control "private" always;
	expires 365d;
	try_files /wp-content/uploads-webpc/$path.$ext.webp $uri =404;

	}
    

	location ~ \.php$ {
    
	try_files $uri =404;
	fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
	fastcgi_index index.php;
	fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
	include fastcgi_params;
	fastcgi_read_timeout 300;

	}
    

	location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webm|htc)$ {
	expires 1M;
	access_log off;
	add_header Cache-Control "public";
	}

	location ~* \.(?:css|js)$ {
	expires 1y;
	access_log off;
	add_header Cache-Control "public";
	}


  	# xmlrpc.php 막기
	location = /xmlrpc.php {
	deny all;
	}


}




gscreen.conf 완벽설정이다. gscreen은 다른 설정과는 약간은 달라 백업해놓는다.
뭐..크게 다른 것은 없으므로 워드프레스용 다른 것을 써도 문제 없다…😀

좋아할만한 추천 글

Leave a Comment

Soledad is the Best Newspaper and Magazine WordPress Theme with tons of options and demos ready to import. This theme is perfect for blogs and excellent for online stores, news, magazine or review sites.

Buy Soledad now!

Edtior's Picks

Latest Articles

ⓒ 2023.  FUNCOM all rights reserved.