Skip to content

Instantly share code, notes, and snippets.

@Fma965
Created June 22, 2018 10:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Fma965/6f587561044a7b65c765ed4eee405bbf to your computer and use it in GitHub Desktop.
Save Fma965/6f587561044a7b65c765ed4eee405bbf to your computer and use it in GitHub Desktop.
Nginx 403 custom error page
<html lang="en">
<head>
<title>Site Blocked!</title>
<style>
@charset "utf-8";
@import url(https://fonts.googleapis.com/css?family=Raleway:400,900,200);
@import url(https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css);
/* This construction page is created by Rafael De Jongh.
** This code is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
Content Table:
--------------
- Reset
- Body
- MediaQueries
- Links
- Scrollbar
- Selection
Reset
------------------*/
html,body,div,span,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,abbr,address,cite,code,del,dfn,em,img,ins,kbd,q,samp,small,strong,sub,sup,var,b,i,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,figcaption,figure,footer,header,hgroup,menu,nav,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;outline:0;font-size:100%;vertical-align:baseline;background:transparent}body{line-height:1}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}nav ul{list-style:none}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:none}a{margin:0;padding:0;font-size:100%;vertical-align:baseline;background:transparent}ins{background-color:#ff9;color:#000;text-decoration:none}mark{background-color:#ff9;color:#000;font-style:italic;font-weight:bold}del{text-decoration:line-through}abbr[title],dfn[title]{border-bottom:1px dotted;cursor:help}table{border-collapse:collapse;border-spacing:0}hr{display:block;height:1px;border:0;border-top:1px solid #ccc;margin:1em 0;padding:0}input,select{vertical-align:middle}
/*Custom Font Icons
//Can be removed
------------------*/
@font-face{
font-family:'cg';
src:url('fonts/cg.eot?51goeb');
src:url('fonts/cg.eot?51goeb#iefix') format('embedded-opentype'),
url('fonts/cg.ttf?51goeb') format('truetype'),
url('fonts/cg.woff?51goeb') format('woff'),
url('fonts/cg.svg?51goeb#cg') format('svg');
font-weight:normal;
font-style:normal;
}
[class^="icon-"], [class*=" icon-"]{
font:normal normal normal 14.5px/1 cg;
speak:none;
line-height:1;
text-transform:none;
-webkit-font-smoothing:antialiased;
-moz-osx-font-smoothing:grayscale;
}
.icon-artstation:before{content:"\e900"}
.icon-gamebanana:before{content:"\e901"}
/*Body
------------------*/
html{
height:100%;
-webkit-box-sizing:border-box;
-moz-box-sizing:border-box;
box-sizing:border-box;
-moz-background-clip:padding-box;
-webkit-background-clip:padding-box;
background-clip:padding-box;
}
body{
font-family:"Raleway", sans-serif;
text-shadow:0 1px 1px rgba(0,0,0,.4);
line-height:1.6;
color:#fff;
background-color:#1b1a1f;
/*PHP Dynamic Background
background-image:url("../images/bg.php");
*/
background-image:url("../images/bg.jpg");
background-repeat:no-repeat;
background-size:cover;
background-attachment:fixed;
background-position:center center;
height:100%;
position:relative;
-webkit-touch-callout:none;
-webkit-user-select:none;
-khtml-user-select:none;
-moz-user-select:none;
-ms-user-select:none;
user-select:none;
}
/*Content
------------------*/
main::before{
content:"";
width:1124px;
height:520px;
position:absolute;
left:-5px;
top:-5px;
z-index:-1;
background:-moz-linear-gradient(-45deg, rgba(115,115,115,.1) 0%, rgba(115,115,115,.09) 9%, rgba(115,115,115,0) 11%, rgba(115,115,115,0) 16%, rgba(115,115,115,.1) 21%, rgba(115,115,115,.09) 37%, rgba(115,115,115,0) 41%, rgba(115,115,115,0) 47%, rgba(115,115,115,.09) 48%, rgba(115,115,115,.1) 49%, rgba(115,115,115,.1) 54%, rgba(115,115,115,.08) 55%, rgba(115,115,115,0) 57%, rgba(115,115,115,0) 60%, rgba(115,115,115,.1) 64%, rgba(115,115,115,.09) 76%, rgba(115,115,115,0) 80%, rgba(115,115,115,.01) 81%, rgba(115,115,115,.1) 84%, rgba(115,115,115,.1) 100%);
background:-webkit-linear-gradient(-45deg, rgba(115,115,115,.1) 0%,rgba(115,115,115,.09) 9%,rgba(115,115,115,0) 11%,rgba(115,115,115,0) 16%,rgba(115,115,115,.1) 21%,rgba(115,115,115,.09) 37%,rgba(115,115,115,0) 41%,rgba(115,115,115,0) 47%,rgba(115,115,115,.09) 48%,rgba(115,115,115,.1) 49%,rgba(115,115,115,.1) 54%,rgba(115,115,115,.08) 55%,rgba(115,115,115,0) 57%,rgba(115,115,115,0) 60%,rgba(115,115,115,.1) 64%,rgba(115,115,115,.09) 76%,rgba(115,115,115,0) 80%,rgba(115,115,115,.01) 81%,rgba(115,115,115,.1) 84%,rgba(115,115,115,.1) 100%);
background:linear-gradient(135deg, rgba(115,115,115,.1) 0%,rgba(115,115,115,.09) 9%,rgba(115,115,115,0) 11%,rgba(115,115,115,0) 16%,rgba(115,115,115,.1) 21%,rgba(115,115,115,.09) 37%,rgba(115,115,115,0) 41%,rgba(115,115,115,0) 47%,rgba(115,115,115,.09) 48%,rgba(115,115,115,.1) 49%,rgba(115,115,115,.1) 54%,rgba(115,115,115,.08) 55%,rgba(115,115,115,0) 57%,rgba(115,115,115,0) 60%,rgba(115,115,115,.1) 64%,rgba(115,115,115,.09) 76%,rgba(115,115,115,0) 80%,rgba(115,115,115,.01) 81%,rgba(115,115,115,.1) 84%,rgba(115,115,115,.1) 100%);
overflow:hidden;
}
main::after{
content:"";
width:1142px;
height:520px;
position:absolute;
z-index:-2;
left:-5px;
top:-5px;
background-repeat:no-repeat;
background-size:cover;
background-attachment:fixed;
background-position:center center;
/*PHP Dynamic Background
background-image:url("../images/bg.php");
background-image:-moz-linear-gradient(90deg, rgba(100,100,100,.2), rgba(100,100,100,.2)), url("../images/bg.php");
background-image:-webkit-linear-gradient(90deg, rgba(100,100,100,.2), rgba(100,100,100,.2)), url("../images/bg.php");
background-image:linear-gradient(0deg, rgba(100,100,100,.2), rgba(100,100,100,.2)), url("../images/bg.php");
*/
background-image:url("../images/bg.jpg");
background-image:-moz-linear-gradient(90deg, rgba(100,100,100,.2), rgba(100,100,100,.2)), url("../images/bg.jpg");
background-image:-webkit-linear-gradient(90deg, rgba(100,100,100,.2), rgba(100,100,100,.2)), url("../images/bg.jpg");
background-image:linear-gradient(0deg, rgba(100,100,100,.2), rgba(100,100,100,.2)), url("../images/bg.jpg");
-webkit-filter:blur(5px);
-moz-filter:blur(5px);
-o-filter:blur(5px);
-ms-filter:blur(5px);
filter:blur(5px);
overflow:hidden;
}
main{
width:1124px;
height:520px;
left:calc(50% - 562px);
top:5%;
position:absolute;
-webkit-border-radius:4px;
-moz-border-radius:4px;
border-radius:4px;
-moz-box-shadow:0 10px 30px rgba(0,0,0,.6);
-webkit-box-shadow:0 10px 30px rgba(0,0,0,.6);
box-shadow:0 10px 30px rgba(0,0,0,.6);
border:1px solid rgba(255, 255, 255,.1);
padding:20px;
text-align:center;
-moz-box-sizing:border-box;
-webkit-box-sizing:border-box;
box-sizing:border-box;
-webkit-transition:box-shadow .3s ease-in-out;
-moz-transition:box-shadow .3s ease-in-out;
-o-transition:box-shadow .3s ease-in-out;
transition:box-shadow .3s ease-in-out;
overflow:hidden;
}
main:hover{
cursor:move;
-moz-box-shadow:0 10px 32px rgba(0,0,0,.7);
-webkit-box-shadow:0 10px 32px rgba(0,0,0,.7);
box-shadow:0 10px 32px rgba(0,0,0,.7);
}
main:active{
cursor:move;
-moz-box-shadow:0 10px 50px rgba(0,0,0,.9);
-webkit-box-shadow:0 10px 50px rgba(0,0,0,.9);
box-shadow:0 10px 50px rgba(0,0,0,.9);
}
main h1{
font-size:2.7em;
text-transform:uppercase;
text-align:center;
width:calc(100% + 10px);
margin-top:20px;
font-weight:200;
}
main h2{
margin-top:.5em;
margin-bottom: .5em;
font-weight:400;
font-size:1.1em;
text-align:center;
}
main h3{
margin-bottom: .5em;}
/*Icons
------------------*/
i{margin:2em 0.4em}
i:before{
font-size:2em;
display:block;
border:1px solid #fff;
padding:1rem;
border-radius:100%;
min-width:32px;
min-height:32px;
-webkit-box-shadow:0 1px 3px rgba(0,0,0,.4);
-moz-box-shadow:0 1px 3px rgba(0,0,0,.4);
box-shadow:0 1px 3px rgba(0,0,0,.4);
}
a i:before{
-webkit-transition:all .3s ease;
-moz-transition:all .3s ease;
-o-transition:all .3s ease;
transition:all .3s ease;
}
a:hover i:before{background-color:rgba(255,255,255,.15)}
/*FadeInOnLoad
------------------*/
@-webkit-keyframes fadeIn{from{opacity:0}to{opacity:1}}
@-moz-keyframes fadeIn{from{opacity:0}to{opacity:1}}
@keyframes fadeIn{from{opacity:0}to{opacity:1}}
main{
opacity:0;
-webkit-animation:fadeIn ease-in 1;
-moz-animation:fadeIn ease-in 1;
animation:fadeIn ease-in 1;
-webkit-animation-fill-mode:forwards;
-moz-animation-fill-mode:forwards;
animation-fill-mode:forwards;
-webkit-animation-duration:.5s;
-moz-animation-duration:.5s;
animation-duration:.5s;
-webkit-animation-delay:.4s;
-moz-animation-delay:.4s;
animation-delay:.4s;
}
/*MediaQueries
------------------*/
@media screen and (max-width:630px){
main::before,main::after{
width:102%;
height:102%;
width:calc(100% + 10px);
height:calc(100% + 10px);
}
main{
width:80%;
height:auto;
margin:auto;
display:inline-block;
left:10%;
}
main h1:before,main h1:after{display:none}
}
@media screen and (max-width:500px){
main h1{font-size:8vw}
}
@media screen and (max-width:450px){
main{top:15%}
}
@media screen and (max-width:410px){
main{top:10%}
}
@media screen and (max-width:320px){
main{top:8%}
i{margin:.6em .5em}
}
/*Links
------------------*/
a{
color:#fff;
text-decoration:none;
-webkit-transition:all .3s ease;
-moz-transition:all .3s ease;
-o-transition:all .3s ease;
transition:all .3s ease;
}
a:visited, a:active, a:hover{color:#fff}
/*Cursor
------------------
*{cursor:url("../images/cursors/default.png"),default}
main *,main:hover,main:active{cursor:url("../images/cursors/move.png"),move}
main a *:hover{cursor:url("../images/cursors/pointer.png"),pointer}
*/
/*Scrollbar
------------------*/
::-webkit-scrollbar{width:12px;height:12px;background-color:#121212}
::-webkit-scrollbar-corner{background-color:#0e0e0e}
::-webkit-scrollbar-track{background-color:#121212}
::-webkit-scrollbar-thumb{background:#900}
::-webkit-scrollbar:horizontal{height:12px}
/*Selection
------------------*/
::selection{color:#fff;background-color:#900}
::-moz-selection{color:#fff;background-color:#900}
</style>
<script src="https://code.jquery.com/jquery-2.2.2.min.js"></script>
<script src="https://code.jquery.com/ui/1.11.4/jquery-ui.min.js"></script>
</head>
<body>
<main>
<img style="height:200px" src="logourl"/>
<h1>is currently not accessible</h1>
<h2>This site is only available to people in selected countries.</h2>
<?php
$ip = $_SERVER['REMOTE_ADDR'];
$details = json_decode(file_get_contents("http://ipinfo.io/{$ip}/json?token=7faed8170a9bb4"));
$country = code_to_country($details->country);
$flag = "https://ipdata.co/flags/" . strtolower($details->country) .".png";
echo "<h3> &nbsp; <img style='width:24px;' src='{$flag}'/> Your IP address is <span style='color:cyan'>{$details->ip}</span> which is located in <span style='color:cyan'>{$country}</span>&nbsp; <img style='width:24px;' src='{$flag}'/> </h3>";
?>
<p>If you believe you should have access and still see this message please email me.</p>
<a href="mailto:admin@domain.tld"><i class="fa fa-envelope"></i></a>
</main>
</body>
</html>
<?php
//Edited by rezker (http://www.rezker.com)
function code_to_country( $code ){
$code = strtoupper($code);
$countryList = array(
'AF' => 'Afghanistan',
'AX' => 'Aland Islands',
'AL' => 'Albania',
'DZ' => 'Algeria',
'AS' => 'American Samoa',
'AD' => 'Andorra',
'AO' => 'Angola',
'AI' => 'Anguilla',
'AQ' => 'Antarctica',
'AG' => 'Antigua and Barbuda',
'AR' => 'Argentina',
'AM' => 'Armenia',
'AW' => 'Aruba',
'AU' => 'Australia',
'AT' => 'Austria',
'AZ' => 'Azerbaijan',
'BS' => 'Bahamas the',
'BH' => 'Bahrain',
'BD' => 'Bangladesh',
'BB' => 'Barbados',
'BY' => 'Belarus',
'BE' => 'Belgium',
'BZ' => 'Belize',
'BJ' => 'Benin',
'BM' => 'Bermuda',
'BT' => 'Bhutan',
'BO' => 'Bolivia',
'BA' => 'Bosnia and Herzegovina',
'BW' => 'Botswana',
'BV' => 'Bouvet Island (Bouvetoya)',
'BR' => 'Brazil',
'IO' => 'British Indian Ocean Territory (Chagos Archipelago)',
'VG' => 'British Virgin Islands',
'BN' => 'Brunei Darussalam',
'BG' => 'Bulgaria',
'BF' => 'Burkina Faso',
'BI' => 'Burundi',
'KH' => 'Cambodia',
'CM' => 'Cameroon',
'CA' => 'Canada',
'CV' => 'Cape Verde',
'KY' => 'Cayman Islands',
'CF' => 'Central African Republic',
'TD' => 'Chad',
'CL' => 'Chile',
'CN' => 'China',
'CX' => 'Christmas Island',
'CC' => 'Cocos (Keeling) Islands',
'CO' => 'Colombia',
'KM' => 'Comoros the',
'CD' => 'Congo',
'CG' => 'Congo the',
'CK' => 'Cook Islands',
'CR' => 'Costa Rica',
'CI' => 'Cote d\'Ivoire',
'HR' => 'Croatia',
'CU' => 'Cuba',
'CY' => 'Cyprus',
'CZ' => 'Czech Republic',
'DK' => 'Denmark',
'DJ' => 'Djibouti',
'DM' => 'Dominica',
'DO' => 'Dominican Republic',
'EC' => 'Ecuador',
'EG' => 'Egypt',
'SV' => 'El Salvador',
'GQ' => 'Equatorial Guinea',
'ER' => 'Eritrea',
'EE' => 'Estonia',
'ET' => 'Ethiopia',
'FO' => 'Faroe Islands',
'FK' => 'Falkland Islands (Malvinas)',
'FJ' => 'Fiji the Fiji Islands',
'FI' => 'Finland',
'FR' => 'France, French Republic',
'GF' => 'French Guiana',
'PF' => 'French Polynesia',
'TF' => 'French Southern Territories',
'GA' => 'Gabon',
'GM' => 'Gambia the',
'GE' => 'Georgia',
'DE' => 'Germany',
'GH' => 'Ghana',
'GI' => 'Gibraltar',
'GR' => 'Greece',
'GL' => 'Greenland',
'GD' => 'Grenada',
'GP' => 'Guadeloupe',
'GU' => 'Guam',
'GT' => 'Guatemala',
'GG' => 'Guernsey',
'GN' => 'Guinea',
'GW' => 'Guinea-Bissau',
'GY' => 'Guyana',
'HT' => 'Haiti',
'HM' => 'Heard Island and McDonald Islands',
'VA' => 'Holy See (Vatican City State)',
'HN' => 'Honduras',
'HK' => 'Hong Kong',
'HU' => 'Hungary',
'IS' => 'Iceland',
'IN' => 'India',
'ID' => 'Indonesia',
'IR' => 'Iran',
'IQ' => 'Iraq',
'IE' => 'Ireland',
'IM' => 'Isle of Man',
'IL' => 'Israel',
'IT' => 'Italy',
'JM' => 'Jamaica',
'JP' => 'Japan',
'JE' => 'Jersey',
'JO' => 'Jordan',
'KZ' => 'Kazakhstan',
'KE' => 'Kenya',
'KI' => 'Kiribati',
'KP' => 'Korea',
'KR' => 'Korea',
'KW' => 'Kuwait',
'KG' => 'Kyrgyz Republic',
'LA' => 'Lao',
'LV' => 'Latvia',
'LB' => 'Lebanon',
'LS' => 'Lesotho',
'LR' => 'Liberia',
'LY' => 'Libyan Arab Jamahiriya',
'LI' => 'Liechtenstein',
'LT' => 'Lithuania',
'LU' => 'Luxembourg',
'MO' => 'Macao',
'MK' => 'Macedonia',
'MG' => 'Madagascar',
'MW' => 'Malawi',
'MY' => 'Malaysia',
'MV' => 'Maldives',
'ML' => 'Mali',
'MT' => 'Malta',
'MH' => 'Marshall Islands',
'MQ' => 'Martinique',
'MR' => 'Mauritania',
'MU' => 'Mauritius',
'YT' => 'Mayotte',
'MX' => 'Mexico',
'FM' => 'Micronesia',
'MD' => 'Moldova',
'MC' => 'Monaco',
'MN' => 'Mongolia',
'ME' => 'Montenegro',
'MS' => 'Montserrat',
'MA' => 'Morocco',
'MZ' => 'Mozambique',
'MM' => 'Myanmar',
'NA' => 'Namibia',
'NR' => 'Nauru',
'NP' => 'Nepal',
'AN' => 'Netherlands Antilles',
'NL' => 'Netherlands the',
'NC' => 'New Caledonia',
'NZ' => 'New Zealand',
'NI' => 'Nicaragua',
'NE' => 'Niger',
'NG' => 'Nigeria',
'NU' => 'Niue',
'NF' => 'Norfolk Island',
'MP' => 'Northern Mariana Islands',
'NO' => 'Norway',
'OM' => 'Oman',
'PK' => 'Pakistan',
'PW' => 'Palau',
'PS' => 'Palestinian Territory',
'PA' => 'Panama',
'PG' => 'Papua New Guinea',
'PY' => 'Paraguay',
'PE' => 'Peru',
'PH' => 'Philippines',
'PN' => 'Pitcairn Islands',
'PL' => 'Poland',
'PT' => 'Portugal, Portuguese Republic',
'PR' => 'Puerto Rico',
'QA' => 'Qatar',
'RE' => 'Reunion',
'RO' => 'Romania',
'RU' => 'Russian Federation',
'RW' => 'Rwanda',
'BL' => 'Saint Barthelemy',
'SH' => 'Saint Helena',
'KN' => 'Saint Kitts and Nevis',
'LC' => 'Saint Lucia',
'MF' => 'Saint Martin',
'PM' => 'Saint Pierre and Miquelon',
'VC' => 'Saint Vincent and the Grenadines',
'WS' => 'Samoa',
'SM' => 'San Marino',
'ST' => 'Sao Tome and Principe',
'SA' => 'Saudi Arabia',
'SN' => 'Senegal',
'RS' => 'Serbia',
'SC' => 'Seychelles',
'SL' => 'Sierra Leone',
'SG' => 'Singapore',
'SK' => 'Slovakia (Slovak Republic)',
'SI' => 'Slovenia',
'SB' => 'Solomon Islands',
'SO' => 'Somalia, Somali Republic',
'ZA' => 'South Africa',
'GS' => 'South Georgia and the South Sandwich Islands',
'ES' => 'Spain',
'LK' => 'Sri Lanka',
'SD' => 'Sudan',
'SR' => 'Suriname',
'SJ' => 'Svalbard & Jan Mayen Islands',
'SZ' => 'Swaziland',
'SE' => 'Sweden',
'CH' => 'Switzerland, Swiss Confederation',
'SY' => 'Syrian Arab Republic',
'TW' => 'Taiwan',
'TJ' => 'Tajikistan',
'TZ' => 'Tanzania',
'TH' => 'Thailand',
'TL' => 'Timor-Leste',
'TG' => 'Togo',
'TK' => 'Tokelau',
'TO' => 'Tonga',
'TT' => 'Trinidad and Tobago',
'TN' => 'Tunisia',
'TR' => 'Turkey',
'TM' => 'Turkmenistan',
'TC' => 'Turks and Caicos Islands',
'TV' => 'Tuvalu',
'UG' => 'Uganda',
'UA' => 'Ukraine',
'AE' => 'United Arab Emirates',
'GB' => 'United Kingdom',
'US' => 'United States of America',
'UM' => 'United States Minor Outlying Islands',
'VI' => 'United States Virgin Islands',
'UY' => 'Uruguay, Eastern Republic of',
'UZ' => 'Uzbekistan',
'VU' => 'Vanuatu',
'VE' => 'Venezuela',
'VN' => 'Vietnam',
'WF' => 'Wallis and Futuna',
'EH' => 'Western Sahara',
'YE' => 'Yemen',
'ZM' => 'Zambia',
'ZW' => 'Zimbabwe'
);
if( !$countryList[$code] ) return $code;
else return $countryList[$code];
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment