mirror of
https://github.com/joglomedia/LEMPer.git
synced 2026-04-06 20:59:08 +00:00
added pagespeed, cors support, new default index page
This commit is contained in:
@@ -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_
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Welcome to nginx!</title>
|
||||
<!--
|
||||
Served by
|
||||
_ _____ __ __ ____
|
||||
| | | ____| \/ | _ \ ___ _ __
|
||||
| | | _| | |\/| | |_) / _ \ '__|
|
||||
| |___| |___| | | | __/ __/ |
|
||||
|_____|_____|_| |_|_| \___|_|
|
||||
-->
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>Default Page</title>
|
||||
<link href="https://fonts.googleapis.com/css?family=Cabin:400,700" rel="stylesheet">
|
||||
<link href="https://fonts.googleapis.com/css?family=Montserrat:900" rel="stylesheet">
|
||||
<link type="text/css" rel="stylesheet" href="css/style.css" />
|
||||
<style>
|
||||
body {
|
||||
width: 35em;
|
||||
margin: 0 auto;
|
||||
font-family: Tahoma, Verdana, Arial, sans-serif;
|
||||
}
|
||||
/**
|
||||
* Forked from Colorlib https://colorlib.com/etc/404/colorlib-error-404-3/
|
||||
*/
|
||||
*{-webkit-box-sizing:border-box;box-sizing:border-box}body{padding:0;margin:0}#errorpg{position:relative;height:100vh}#errorpg .errorpg{position:absolute;left:50%;top:50%;-webkit-transform:translate(-50%,-50%);-ms-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}.errorpg{max-width:520px;width:100%;line-height:1.4;/*text-align:center*/}.errorpg .errorpg-msg{position:relative;height:240px}.errorpg .errorpg-msg h1{font-family:Montserrat,sans-serif;position:absolute;left:50%;top:50%;-webkit-transform:translate(-50%,-50%);-ms-transform:translate(-50%,-50%);transform:translate(-50%,-50%);font-size:252px;font-weight:900;margin:0;color:#262626;text-transform:uppercase;letter-spacing:-40px;margin-left:-20px}.errorpg .errorpg-msg h1>span{text-shadow:-8px 0 0 #fff}.errorpg .errorpg-msg h3{font-family:Cabin,sans-serif;position:relative;font-size:16px;font-weight:700;text-transform:uppercase;color:#262626;margin:0;letter-spacing:3px;padding-left:6px}.errorpg h2{font-family:Cabin,sans-serif;font-size:20px;font-weight:400;text-transform:uppercase;color:#000;margin-top:0;margin-bottom:25px}@media only screen and (max-width:767px){.errorpg .errorpg-msg{height:200px}.errorpg .errorpg-msg h1{font-size:200px}}@media only screen and (max-width:480px){.errorpg .errorpg-msg{height:162px}.errorpg .errorpg-msg h1{font-size:162px;height:150px;line-height:162px}.errorpg h2{font-size:16px}}
|
||||
div.banner{color:#009639;font-family:Montserrat,sans-serif;position:absolute;left:50%;top:50%;-webkit-transform:translate(-50%,-50%);-ms-transform:translate(-50%,-50%);transform:translate(-50%,-50%);font-size:180px;font-weight:900;margin:0;letter-spacing:-25px;margin-left:-10px}
|
||||
</style>
|
||||
<!--[if lt IE 9]>
|
||||
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
|
||||
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
</head>
|
||||
<body>
|
||||
<h1>Welcome to nginx!</h1>
|
||||
<p>If you see this page, the nginx web server is successfully installed using LEMPer. Further configuration is required.</p>
|
||||
|
||||
<p>For online documentation and support please refer to
|
||||
<a href="http://nginx.org/">nginx.org</a>.<br/>
|
||||
LEMPer and ngxTools support is available at
|
||||
<a href="https://github.com/joglomedia/LEMPer/issues">LEMPer Github</a>.</p>
|
||||
|
||||
<p><em>Thank you for using nginx, ngxTools, and LEMPer.</em></p>
|
||||
|
||||
<p style="font-size:90%;">Generated using <em>LEMPer</em> from <a href="https://eslabs.id/lemper">Nginx vHost Tool</a>, a simple nginx web server management tool.</p>
|
||||
<div id="errorpg">
|
||||
<div class="errorpg">
|
||||
<div class="errorpg-msg">
|
||||
<h3>Bad_Coder presents...</h3>
|
||||
<div class="banner">
|
||||
<span>L</span><span>E</span><span>M</span><span>P</span><span>er</span></div>
|
||||
</div>
|
||||
<h2>This is the default index page of your website.</h2>
|
||||
<p>This file may be deleted or overwritten without any difficulty. This is produced by the file index.html in the web directory.</p>
|
||||
<p>To disable this page, please remove the index.html file and replace it with your own. Our handy <a href="https://github.com/joglomedia/LEMPer/wiki">Quick Start Guide</a> can help you get up and running fast.</p>
|
||||
<p>For questions or problems, please contact our support team.</p>
|
||||
</div>
|
||||
</div>
|
||||
<script src="https://ajax.cloudflare.com/cdn-cgi/scripts/95c75768/cloudflare-static/rocket-loader.min.js" data-cf-settings="d841170f43ff1e03f58512ad-|49" defer=""></script>
|
||||
</body>
|
||||
</html>
|
||||
_EOF_
|
||||
|
||||
Reference in New Issue
Block a user