diff --git a/lib/lemper-create.sh b/lib/lemper-create.sh index fc22a05..5b75dd8 100755 --- a/lib/lemper-create.sh +++ b/lib/lemper-create.sh @@ -199,33 +199,31 @@ server { #pagespeed Domain ${SERVERNAME}; #pagespeed Domain *.${SERVERNAME}; - # Enable fetch HTTPS. - #pagespeed FetchHttps enable; - # This setting should be enabled when using HTTPS # Take care when using HTTP > HTTPS redirection to avoid loops. #pagespeed MapOriginDomain "http://\$server_name" "https://\$server_name"; - # Async Google Analytics - #pagespeed EnableFilters make_google_analytics_async; + # Enable fetch HTTPS (enabled by default). + #pagespeed FetchHttps enable; - # Async Google Adsense. - #pagespeed EnableFilters make_show_ads_async; - - # PageSpeed should be disabled on the WP admin (adjust to suit custom admin URLs). + # PageSpeed should be disabled on the WP admin (adjust to suit custom admin URLs). #pagespeed Disallow "*/wp-admin/*"; #pagespeed Disallow "*/dashboard/*"; #pagespeed Disallow "*/admin/*"; + ## Access control Cross-origin Resource Sharing (CORS). + set \$cors "http://*.\$server_name, https://*.\$server_name"; + #include /etc/nginx/includes/cors.conf; + + # PageSpeed CORS support. + #pagespeed AddResourceHeader "Access-Control-Allow-Origin" "http://*.\$server_name"; + #pagespeed AddResourceHeader "Access-Control-Allow-Origin" "https://*.\$server_name"; + ## Global directives configuration. include /etc/nginx/includes/rules_security.conf; include /etc/nginx/includes/rules_staticfiles.conf; include /etc/nginx/includes/rules_restriction.conf; - ## Access control Cross-origin Resource Sharing (CORS). - set \$cors "http://*.\$server_name, https://*.\$server_name"; - #include /etc/nginx/includes/cors.conf; - ## Default vhost directives configuration. #include /etc/nginx/includes/rules_fastcgi_cache.conf; include /etc/nginx/vhost/site_${FRAMEWORK}.conf; @@ -250,9 +248,6 @@ server { fastcgi_pass unix:/run/php/php${PHP_VERSION}-fpm.${USERNAME}.sock; } - ## Uncomment to enable error page directives configuration. - #include /etc/nginx/includes/error_pages.conf; - ## PHP-FPM status monitoring location ~ ^/(status|ping)$ { include /etc/nginx/fastcgi_params; @@ -264,6 +259,9 @@ server { auth_basic_user_file /srv/.htpasswd; } + ## Uncomment to enable error page directives configuration. + include /etc/nginx/includes/error_pages.conf; + ## Add your custom site directives here. } _EOF_ @@ -302,23 +300,25 @@ server { #pagespeed Domain ${SERVERNAME}; #pagespeed Domain *.${SERVERNAME}; - # Enable fetch HTTPS. + # Enable fetch HTTPS (enabled by default). #pagespeed FetchHttps enable; # This setting should be enabled when using HTTPS # Take care when using HTTP > HTTPS redirection to avoid loops. #pagespeed MapOriginDomain "http://\$server_name" "https://\$server_name"; - # Async Google Analytics - #pagespeed EnableFilters make_google_analytics_async; - - # Async Google Adsense. - #pagespeed EnableFilters make_show_ads_async; - - # PageSpeed should be disabled on the user panel (adjust to suit custom admin URLs). + # PageSpeed should be disabled on the user panel (adjust to suit custom admin URLs). #pagespeed Disallow "*/user/*"; #pagespeed Disallow "*/account/*"; + ## Access control Cross-origin Resource Sharing (CORS). + set \$cors "http://*.\$server_name, https://*.\$server_name"; + #include /etc/nginx/includes/cors.conf; + + # PageSpeed CORS support. + #pagespeed AddResourceHeader "Access-Control-Allow-Origin" "http://*.\$server_name"; + #pagespeed AddResourceHeader "Access-Control-Allow-Origin" "https://*.\$server_name"; + ## Global directives configuration. include /etc/nginx/includes/rules_security.conf; include /etc/nginx/includes/rules_staticfiles.conf; @@ -336,19 +336,6 @@ server { # Include FastCGI Params. include /etc/nginx/fastcgi_params; - # Overwrite FastCGI Params here. - # Block httpoxy attacks. See https://httpoxy.org/. - fastcgi_param HTTP_PROXY ""; - fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name; - fastcgi_param PATH_INFO \$fastcgi_path_info; - fastcgi_param QUERY_STRING \$query_string; - - # Comment out HTTPS line for PHP behind SSL https. - # old pre .03 method - #fastcgi_param HTTPS on; - # new .04+ map method - #fastcgi_param HTTPS \$server_https; - # Include FastCGI Configs. include /etc/nginx/includes/fastcgi.conf; @@ -359,9 +346,6 @@ server { fastcgi_pass unix:/run/php/php${PHP_VERSION}-fpm.${USERNAME}.sock; } - ## Uncomment to enable error page directives configuration. - #include /etc/nginx/includes/error_pages.conf; - ## PHP-FPM status monitoring location ~ ^/(status|ping)$ { include /etc/nginx/fastcgi_params; @@ -373,6 +357,9 @@ server { auth_basic_user_file /srv/.htpasswd; } + ## Uncomment to enable error page directives configuration. + include /etc/nginx/includes/error_pages.conf; + ## Add your custom site directives here. } _EOF_ @@ -414,24 +401,26 @@ server { #pagespeed Domain ${SERVERNAME}; #pagespeed Domain *.${SERVERNAME}; - # Enable fetch HTTPS. + # Enable fetch HTTPS (enabled by default). #pagespeed FetchHttps enable; # This setting should be enabled when using HTTPS # Take care when using HTTP > HTTPS redirection to avoid loops. #pagespeed MapOriginDomain "http://\$server_name" "https://\$server_name"; - # Async Google Analytics - #pagespeed EnableFilters make_google_analytics_async; - - # Async Google Adsense. - #pagespeed EnableFilters make_show_ads_async; - - # PageSpeed should be disabled on the admin (adjust to suit custom admin URLs). + # PageSpeed should be disabled on the admin (adjust to suit custom admin URLs). #pagespeed Disallow "*/account/*"; #pagespeed Disallow "*/dashboard/*"; #pagespeed Disallow "*/admin/*"; + ## Access control Cross-origin Resource Sharing (CORS). + set \$cors "http://*.\$server_name, https://*.\$server_name"; + #include /etc/nginx/includes/cors.conf; + + # PageSpeed CORS support. + #pagespeed AddResourceHeader "Access-Control-Allow-Origin" "http://*.\$server_name"; + #pagespeed AddResourceHeader "Access-Control-Allow-Origin" "https://*.\$server_name"; + ## Global directives configuration. include /etc/nginx/includes/rules_security.conf; include /etc/nginx/includes/rules_staticfiles.conf; @@ -449,9 +438,6 @@ server { # Include FastCGI Params. include /etc/nginx/fastcgi_params; - # Overwrite FastCGI Params here. - fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name; - # Include FastCGI Configs. include /etc/nginx/includes/fastcgi.conf; @@ -462,9 +448,6 @@ server { fastcgi_pass unix:/run/php/php${PHP_VERSION}-fpm.${USERNAME}.sock; } - ## Uncomment to enable error page directives configuration. - #include /etc/nginx/includes/error_pages.conf; - ## PHP-FPM status monitoring location ~ ^/(status|ping)$ { include /etc/nginx/fastcgi_params; @@ -476,6 +459,9 @@ server { auth_basic_user_file /srv/.htpasswd; } + ## Uncomment to enable error page directives configuration. + include /etc/nginx/includes/error_pages.conf; + ## Add your custom site directives here. } _EOF_ @@ -517,24 +503,26 @@ server { #pagespeed Domain ${SERVERNAME}; #pagespeed Domain *.${SERVERNAME}; - # Enable fetch HTTPS. + # Enable fetch HTTPS (enabled by default). #pagespeed FetchHttps enable; # This setting should be enabled when using HTTPS # Take care when using HTTP > HTTPS redirection to avoid loops. #pagespeed MapOriginDomain "http://\$server_name" "https://\$server_name"; - # Async Google Analytics - #pagespeed EnableFilters make_google_analytics_async; - - # Async Google Adsense. - #pagespeed EnableFilters make_show_ads_async; - # PageSpeed should be disabled on the admin (adjust to suit custom admin URLs). #pagespeed Disallow "*/account/*"; #pagespeed Disallow "*/dashboard/*"; #pagespeed Disallow "*/admin/*"; + ## Access control Cross-origin Resource Sharing (CORS). + set \$cors "http://*.\$server_name, https://*.\$server_name"; + #include /etc/nginx/includes/cors.conf; + + # PageSpeed CORS support. + #pagespeed AddResourceHeader "Access-Control-Allow-Origin" "http://*.\$server_name"; + #pagespeed AddResourceHeader "Access-Control-Allow-Origin" "https://*.\$server_name"; + ## Global directives configuration. include /etc/nginx/includes/rules_security.conf; include /etc/nginx/includes/rules_staticfiles.conf; @@ -570,9 +558,6 @@ server { fastcgi_pass unix:/run/php/php${PHP_VERSION}-fpm.${USERNAME}.sock; } - ## Uncomment to enable error page directives configuration. - #include /etc/nginx/includes/error_pages.conf; - ## PHP-FPM status monitoring location ~ ^/(status|ping)$ { include /etc/nginx/fastcgi_params; @@ -584,6 +569,9 @@ server { auth_basic_user_file /srv/.htpasswd; } + ## Uncomment to enable error page directives configuration. + include /etc/nginx/includes/error_pages.conf; + ## Add your custom site directives here. } _EOF_ @@ -630,29 +618,50 @@ _EOF_ function create_index_file() { cat <<- _EOF_ - + -Welcome to nginx! + + + + +Default Page + + + + -

Welcome to nginx!

-

If you see this page, the nginx web server is successfully installed using LEMPer. Further configuration is required.

- -

For online documentation and support please refer to -nginx.org.
-LEMPer and ngxTools support is available at -LEMPer Github.

- -

Thank you for using nginx, ngxTools, and LEMPer.

- -

Generated using LEMPer from Nginx vHost Tool, a simple nginx web server management tool.

+
+
+
+

Bad_Coder presents...

+ +
+

This is the default index page of your website.

+

This file may be deleted or overwritten without any difficulty. This is produced by the file index.html in the web directory.

+

To disable this page, please remove the index.html file and replace it with your own. Our handy Quick Start Guide can help you get up and running fast.

+

For questions or problems, please contact our support team.

+
+
+ _EOF_