initial commit

pull/2/head
Szekeres Bálint 2018-01-07 16:30:12 +01:00
commit 1bbaee1cde
18 changed files with 741 additions and 0 deletions

13
.editorconfig Normal file
View File

@ -0,0 +1,13 @@
root = true
[*]
charset = utf-8
indent_style = tab
indent_size = 4
tab_width = 4
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
[*.conf.html]
insert_final_newline = false

125
public/assets/css/app.css Normal file
View File

@ -0,0 +1,125 @@
body {
display: flex;
flex-direction: column;
min-height: 100vh;
font-family: 'Quicksand', sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.info {
cursor: pointer;
}
.info:hover {
opacity: 1;
}
header {
background-color: #000;
box-shadow: 0 5px 10px 10px #000;
padding: 0.5rem 0 0;
text-align: center;
margin-bottom: 2.25rem;
color: #fff;
font-size: 2.2rem;
}
header img.nginx {
height: 1.6rem;
vertical-align: -0.1rem;
}
header img.config {
height: 1.2rem;
vertical-align: super;
opacity: 0.8;
margin-left: -0.5rem;
margin-right: -0.25rem;
}
main {
flex: 1 1 auto;
}
main .options,
main .sidebar {
padding-top: 1.5rem;
}
main .options .card .card-body {
padding: 0.6rem 0.75rem;
}
main .options .card + .card {
margin-top: 1rem;
}
main .options .card .card-body .form-label {
margin-bottom: 0.15rem;
margin-left: 0.15rem;
}
main .options .card .card-body .form-group {
margin-bottom: 0.5rem;
}
main .options .card .card-body .form-group:last-child {
margin-bottom: 0;
}
main .file {
margin-bottom: 2rem;
}
main .file .code {
padding: 0.5rem;
overflow-x: auto;
font-size: 0.75rem;
line-height: 1.25;
background-color: #f8f8f8;
}
main .file .code.source {
display: none;
}
main .file .code pre {
margin-bottom: 0;
font-size: inherit;
}
main .file .code pre code {
-moz-tab-size: 4;
tab-size: 4;
overflow: visible;
overflow-x: visible;
}
main .file .code pre code ng-include {
display: inline-block;
}
footer {
padding: 2rem 0 0.5rem;
text-align: center;
font-size: 0.8rem;
}
footer img.balaton {
height: 1.6rem;
vertical-align: middle;
}
.adsbygoogle-container .adsbygoogle {
display: block;
height: 600px;
position: relative;
background-color: #f8f8f8;
}
.adsbygoogle-container .note {
text-align: center;
color: #444;
font-size: 0.6rem;
}

View File

@ -0,0 +1 @@
.hljs{display:block;overflow-x:auto;padding:0.5em;color:#333;background:#f8f8f8}.hljs-comment,.hljs-quote{color:#998;font-style:italic}.hljs-keyword,.hljs-selector-tag,.hljs-subst{color:#333;font-weight:bold}.hljs-number,.hljs-literal,.hljs-variable,.hljs-template-variable,.hljs-tag .hljs-attr{color:#008080}.hljs-string,.hljs-doctag{color:#d14}.hljs-title,.hljs-section,.hljs-selector-id{color:#900;font-weight:bold}.hljs-subst{font-weight:normal}.hljs-type,.hljs-class .hljs-title{color:#458;font-weight:bold}.hljs-tag,.hljs-name,.hljs-attribute{color:#000080;font-weight:normal}.hljs-regexp,.hljs-link{color:#009926}.hljs-symbol,.hljs-bullet{color:#990073}.hljs-built_in,.hljs-builtin-name{color:#0086b3}.hljs-meta{color:#999;font-weight:bold}.hljs-deletion{background:#fdd}.hljs-addition{background:#dfd}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:bold}

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 627.1056 324.7641"><defs><style>.a{fill:#1ca3ec;}</style></defs><title>Balaton</title><path class="a" d="M90.3918,323.3a74.2016,74.2016,0,0,1-15-4.5136A93.2753,93.2753,0,0,0,63.89,314.4006c-6.9209-1.9122-24.2238-1.8364-28.922.1266-2.0163.8425-4.08,1.276-4.586.9633s-3.5886.123-6.85.9682a48.02,48.02,0,0,1-8.9416,1.5367c-3.7945,0-10.9946-3.7737-12.9888-6.8076A5.5191,5.5191,0,0,1,.224,309.49a1.5717,1.5717,0,0,1-.14-.61c-.37-2.31.5993-15.3467.5993-15.3467C1.062,283.84,1.8048,276.9372,2.7,274.7944c2.1346-5.1089,7.0594-8.799,11.7432-8.799,4.4743,0,15.668,3.9537,20.0718,7.0895,1.6429,1.17,6.3539,2.9683,10.469,3.9967a122.528,122.528,0,0,1,14.6747,4.8917c3.9561,1.6622,4.7,2.4937,8.1078,2.1907,3.4646-.3081,6.8412-6.1106,8.3853-10.3419.9076-2.4871,2.7288-5.4178,12.7375-17.24,3.85-4.5474,8.4892-10.4157,10.3092-13.0407,0,0,.9538-4.3017,3.3092-4.7727a11.4836,11.4836,0,0,1,3.7784.0193,43.6936,43.6936,0,0,0,7.1274.4944,6.3312,6.3312,0,0,1,4.0615.7126,18.7766,18.7766,0,0,1,4.7072,4.3909c4.0709,3.7974,9.3163,5.96,13.1918,5.5346A13.4842,13.4842,0,0,0,141.7,247.279s2.7693-3.1226,4.535-3.1226c1.7815,0,4.3659,1.7779,4.3659,1.7779,2.995,1.6786,6.9157,3.4678,10.1774,5.0977s7.46,2.9634,9.3291,2.9634h3.3987l4.1081-4.514a39.9127,39.9127,0,0,0,5.8333-8.3675,15.5629,15.5629,0,0,1,3.9725-5.4275l2.2473-1.574,8.111.5648,8.111.5649,7.8519-3.3048,7.8521-3.3049,2.262-3.5832c3.5165-5.5705,4.9714-6.4028,9.99-5.7148a15.2911,15.2911,0,0,0,8.1309-.94,15.2874,15.2874,0,0,1,8.3136-.9127,25.0077,25.0077,0,0,0,4.6113.55c1.71-.7893,4.4939-1.9546,4.4939-1.9546a23.7026,23.7026,0,0,1,7.6214-2.06c3.6309-.0255,4.598-1.0473,6.1731-6.522.7612-2.6461,3.8579-6.9919,9.1486-12.8392a135.0314,135.0314,0,0,0,10.0629-12.1805c2.6023-4.21,13.6208-12.48,16.6285-12.48a14.1258,14.1258,0,0,1,4.83,1.1685l2.5646,1.1685,4.2325-2.0767c5.0093-2.4579,14.9725-4.6363,17.5144-3.8295.9875.3134,4.3875-.1053,7.5555-.93a48.0181,48.0181,0,0,1,9.6144-1.5h3.8542l2.847-3.4548c1.9948-2.4207,5.0917-4.3269,10.3469-6.3687l7.5-2.914,1.3046-2.6312c.7175-1.4472,1.6452-2.6313,2.0614-2.6313a8.44,8.44,0,0,0,2.9387-2.0326,29.53,29.53,0,0,1,6.8584-4.0373,24.6707,24.6707,0,0,0,6.9591-4.4674c1.2553-1.3545,3.12-2.4627,4.143-2.4627,2.904,0,7.2349,5.1562,7.2349,8.6136,0,4.0186,1.5427,5.6439,15.7916,16.6364l3.5646,2.75h4.1994c4.7394,0,5.6057-.789,7.2713-6.6229l1.1772-4.123-1.5021-3.5949a21.0475,21.0475,0,0,1-1.502-6.6669c0-3.8167-3.3569-10.5777-5.9376-11.9589a16.2861,16.2861,0,0,0-6.0422-1.0334h-4.1112l-2.4545-2.4546c-1.35-1.35-2.4545-3.22-2.4545-4.1556,0-2.73,4.7862-8.24,9.0433-10.4119a17.5966,17.5966,0,0,0,5.45-4.3276c2.7611-3.9563,11.2127-9.9027,14.2345-9.9027,4.7246,0,9.0567-1.0786,9.2721-4.1132.33-4.6443,4.4264-11.2951,7.888-5.8938l5.388-.4735,3.1553-3.7583,3.1552-3.7583,4.1133-1.2108c2.1762.2812,4.6024,1.6085,5.7744,1.993a2.6561,2.6561,0,0,0,3.0783-.6365c.6073-.7345,2.5224-1.7795,3.8731-3.47a14.7774,14.7774,0,0,1,6.4988-4.2852c2.3343-.6994,4.5209-2.1473,5.1738-3.4261a47.8936,47.8936,0,0,1,5.9218-7.2147c4.7719-4.98,9.1844-13.9576,10.5832-21.5319.9769-5.29,2.9954-7.7676,7.4046-9.0886,2.2087-.6618,4.4968-1.7826,5.0845-2.4908s1.2186-4.5729,1.4018-8.5882.852-8.65,1.4861-10.3C538.677,4.0942,542.2028-.0069,543.8139,0c1.6092.0069,7.1142,5.4561,11.4738,11.3575,2.419,3.2745,5.305,5.847,7.7309,6.8912,8.9213,3.84,11.0414,4.8708,14.33,6.9685a5.1642,5.1642,0,0,0,3.459,2.2064,25.9359,25.9359,0,0,0,6.6607.1236s4.1293-1.144,6.6608.1237a13.7374,13.7374,0,0,1,4.2939,4.126,37.39,37.39,0,0,0,7.88,5.8069,81.7971,81.7971,0,0,1,10.1341,6.5234s5.2757,3.3876,6.5478,4.8425c.963,1.1014,1.6992,4.7629,1.6992,4.7629,2.7,7.5688,3.1356,13.2968,1.3375,17.6a42.3532,42.3532,0,0,0-2.25,8.9707c-1.4438,11.1736-9.048,23.5356-21.5858,35.0916-4.5632,4.2058-10.0968,8.507-12.2968,9.558s-8.275,3.8954-13.5,6.3207-12.875,6.0214-17,7.9914a102.17,102.17,0,0,1-13.3789,5.2215,33.9971,33.9971,0,0,0-8.5,3.5394c-1.4416,1.0449-6.22,2.6317-10.619,3.5262a89.9782,89.9782,0,0,0-13.9368,4.1261,82.6583,82.6583,0,0,1-12.0021,3.8167c-3.3347.7243-8.5382,1.85-11.5632,2.501s-7.3,1.7629-9.5,2.47a66.1766,66.1766,0,0,1-11,1.9561,85.8591,85.8591,0,0,0-20.11,4.578l-2.11.8241-.7056,5.3195-.7057,5.32-4.4267,4.2415a43.7826,43.7826,0,0,1-8.2513,6.1927,20.7171,20.7171,0,0,0-5.041,3.4167,13.5726,13.5726,0,0,1-4.4331,2.7516,34.9955,34.9955,0,0,0-6.8159,4.072c-3.3064,2.56-32.1878,16.5443-37.9278,18.3652-1.36.4315-6.2982,2.701-10.9732,5.0432-16.3642,8.1987-30.5385,14.6752-35,15.992-2.4751.7306-7.4723,2.451-11.105,3.8233a93.2767,93.2767,0,0,1-13,3.6954,145.0627,145.0627,0,0,0-15.1629,4.1064,138.4723,138.4723,0,0,1-14.4726,3.9607,18.4541,18.4541,0,0,0-8.8964,3.8569,22.8144,22.8144,0,0,1-7.0274,3.9663c-3.9336,1.1937-6.5976,2.2683-21.3357,8.6058-9.3459,4.0188-22.2137,8.4419-24.56,8.4419-1.8621,0-12.8154,5.4783-16.7147,8.36a38.3922,38.3922,0,0,0-6.3454,6.94,19.1081,19.1081,0,0,1-7.6791,6.6134,18.9218,18.9218,0,0,0-5.5386,3.39c-1.1815,1.4238-4.3937,2.7783-20.6628,8.7131C140.9728,323.9129,109.7487,326.7378,90.3918,323.3Z"/></svg>

After

Width:  |  Height:  |  Size: 4.9 KiB

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 980 980"><defs><style>.a{fill:#fff;}</style></defs><title>config</title><path class="a" d="M946,802.1l34-173.6L790.9,439.4l.3-1.4-1.2.5-.1-.1v.2L642.5,500.2,479.8,337.6l61.6-147.4h.2l-.1-.1.5-1.2-1.4.3L351.5,0,177.9,34,368,224.1h.1L325.6,325.7,224,368.2v-.1L34,177.9,0,351.5,189.1,540.6l-.3,1.4,1.2-.5.1.1v-.2l146.2-61.1L499.5,643.5,438.4,789.7h-.2l.1.1-.5,1.2,1.4-.3L628.5,980l173.6-34L612,755.9h-.1l42.5-101.6L756,611.8v.1Z"/></svg>

After

Width:  |  Height:  |  Size: 488 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 115.0745 24.1199"><defs><style>.a{fill:none;stroke:#090;stroke-linecap:round;stroke-linejoin:round;stroke-width:5px;}.b{fill:#090;}</style></defs><title>nginx</title><path class="a" d="M2.5,21.5715V2.5068L21.5625,21.5715V2.5068"/><path class="b" d="M33.14.0314l-.6875,1.2813L27.14,10.9689l-.6875,1.2188.6875,1.2187L32.4522,22.75l.7187,1.2812H47.0772l.6875-1.4062,3.9687-8L53.5147,11H49.4834l-10.1562.0312a2.5994,2.5994,0,0,0-2.5356,2.5,2.5994,2.5994,0,0,0,2.5356,2.5L45.4522,16l-1.5,3.0312h-7.875l-3.9063-6.875,3.9375-7.125h8.3772l1.9532,4.0078H51.47L48.2981,1.4377,47.6106.0314H33.14Z"/><path class="b" d="M58.4659,0a2.5981,2.5981,0,0,0-2.4687,2.5312V9.0459h5V2.5314A2.6,2.6,0,0,0,58.4659,0Z"/><path class="a" d="M85.5434,21.62V2.5552L66.4809,21.62V2.5552"/><path class="a" d="M93.4674,2.5482l19.0848,19.0179"/><path class="a" d="M112.5745,2.5482,93.49,21.5661"/><path class="b" d="M58.4659,24.048a2.5982,2.5982,0,0,1-2.4687-2.5313V11.0524h5V21.5167A2.6,2.6,0,0,1,58.4659,24.048Z"/></svg>

After

Width:  |  Height:  |  Size: 1.0 KiB

54
public/assets/js/app.js Normal file
View File

@ -0,0 +1,54 @@
(function() {
angular
.module('NginxConfigIoApp', [])
.controller('NginxConfigIoController', function NginxConfigIoController($scope, $timeout) {
$scope.data = {
domain: 'example.com',
path: '/var/www/example.com',
document_root: '/public',
https: false,
http2: true,
email: 'hello@example.com',
non_www: true,
php: '7.2',
index_html: false,
wordpress: false,
file_structure: 'unified',
worker_processes: 'auto',
user: 'www-data',
pid: '/run/nginx.pid',
access_log: '/var/log/nginx/access.log',
error_log: '/var/log/nginx/error.log',
gzip: true,
server_tokens: false,
log_not_found: false,
limit_req: false,
expires: {
css_js: '7d',
media: '7d',
svg: '7d',
font: '7d',
},
};
$scope.refreshHighlighting = function() {
document.querySelectorAll('main .file .code.source').forEach(function(code) {
$timeout(function(code) {
code.nextSibling.innerHTML = code.innerHTML;
if (code.nextSibling.children.length && code.nextSibling.children[0].children.length) {
hljs.highlightBlock(code.nextSibling.children[0].children[0]);
}
}, 0, true, code);
});
};
$scope.$watch('data', function(data) {
$scope.refreshHighlighting();
}, true);
});
})();

2
public/assets/js/highlight.min.js vendored Normal file

File diff suppressed because one or more lines are too long

280
public/index.html Normal file
View File

@ -0,0 +1,280 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.3/css/bootstrap.min.css" integrity="sha384-Zug+QiDoJOrZ5t4lssLdxGhVrurbmBWopoEl+M6BdEfwnCJZtKxi1KgxUyJq13dy" crossorigin="anonymous">
<link href="https://fonts.googleapis.com/css?family=Quicksand:400,700" rel="stylesheet">
<link rel="stylesheet" href="assets/css/highlight-github.min.css">
<link rel="stylesheet" href="assets/css/app.css">
<link rel="icon" type="image/png" href="assets/img/favicon.png">
<title>nginxconfig.io</title>
</head>
<body ng-app="NginxConfigIoApp">
<header>
<div class="container-fluid">
<img src="assets/img/nginx.svg" alt="nginx" class="nginx">
<img src="assets/img/config.svg" alt="config" class="config">
config.io
</div>
</header>
<main ng-controller="NginxConfigIoController">
<div class="container-fluid">
<div class="row">
<div class="col-md-3 col-lg-2 options">
<div class="card">
<div class="card-body">
<div class="form-group">
<label class="form-label"><span class="info">Domain</span></label>
<input type="text" class="form-control form-control-sm" ng-model="data.domain">
</div>
<div class="form-group">
<label class="form-label"><span class="info">Path</span></label>
<input type="text" class="form-control form-control-sm" ng-model="data.path">
</div>
<div class="form-group">
<label class="form-label"><span class="info">Document root</span></label>
<input type="text" class="form-control form-control-sm" ng-model="data.document_root">
</div>
<div class="form-check">
<input class="form-check-input" type="checkbox" id="https" ng-model="data.https">
<label class="form-check-label" for="https">
<span class="info">HTTPS</span>
</label>
</div>
<div class="form-check" ng-if="data.https">
<input class="form-check-input" type="checkbox" id="http2" ng-model="data.http2">
<label class="form-check-label" for="http2">
<span class="info">HTTP2</span>
</label>
</div>
<div class="form-group" ng-if="data.https">
<label class="form-label">E-mail</label>
<input type="text" class="form-control form-control-sm" ng-model="data.email">
</div>
<div class="form-check">
<input class="form-check-input" type="checkbox" id="non_www" ng-model="data.non_www">
<label class="form-check-label" for="non_www">
<span class="info">non-www</span>
</label>
</div>
</div>
</div>
<div class="card">
<div class="card-body">
<div class="form-group">
<label>PHP</label>
<select class="form-control" ng-model="data.php">
<option value="off">off</option>
<option value="tcp">TCP</option>
<option value="5.x">5.x socket</option>
<option value="7.0">7.0 socket</option>
<option value="7.1">7.1 socket</option>
<option value="7.2">7.2 socket</option>
</select>
</div>
<div class="form-check" ng-if="data.php !== 'off'">
<input class="form-check-input" type="checkbox" id="index_html" ng-model="data.index_html">
<label class="form-check-label" for="index_html">
<span class="info">index.html</span>
</label>
</div>
<div class="form-check" ng-if="data.php !== 'off'">
<input class="form-check-input" type="checkbox" id="wordpress" ng-model="data.wordpress">
<label class="form-check-label" for="wordpress">
<span class="info">WordPress</span>
</label>
</div>
</div>
</div>
<div class="card">
<div class="card-body">
<label class="form-label">File structure</label>
<div class="form-check">
<input class="form-check-input" type="radio" id="unified" ng-model="data.file_structure" value="unified">
<label class="form-check-label" for="unified">
<span class="info">unified</span>
</label>
</div>
<div class="form-check">
<input class="form-check-input" type="radio" id="separated" ng-model="data.file_structure" value="separated">
<label class="form-check-label" for="separated">
<span class="info">separated</span>
</label>
</div>
</div>
</div>
<div class="card">
<div class="card-body">
<div class="form-group">
<label><code>worker_processes</code></label>
<select class="form-control" ng-model="data.worker_processes">
<option value="auto">auto</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
<option value="11">11</option>
<option value="12">12</option>
<option value="13">13</option>
<option value="14">14</option>
<option value="15">15</option>
<option value="16">16</option>
</select>
</div>
<div class="form-group">
<label class="form-label"><code class="info">user</code></label>
<input type="text" class="form-control form-control-sm" ng-model="data.user">
</div>
<div class="form-group">
<label class="form-label"><code class="info">pid</code></label>
<input type="text" class="form-control form-control-sm" ng-model="data.pid">
</div>
<div class="form-group">
<label class="form-label"><code class="info">access_log</code></label>
<input type="text" class="form-control form-control-sm" ng-model="data.access_log">
</div>
<div class="form-group">
<label class="form-label"><code class="info">error_log</code></label>
<input type="text" class="form-control form-control-sm" ng-model="data.error_log">
</div>
<div class="form-check">
<input class="form-check-input" type="checkbox" id="gzip" ng-model="data.gzip">
<label class="form-check-label" for="gzip">
<span class="info"><code>gzip</code></span>
</label>
</div>
<div class="form-check">
<input class="form-check-input" type="checkbox" id="server_tokens" ng-model="data.server_tokens">
<label class="form-check-label" for="server_tokens">
<span class="info"><code>server_tokens</code></span>
</label>
</div>
<div class="form-check">
<input class="form-check-input" type="checkbox" id="log_not_found" ng-model="data.log_not_found">
<label class="form-check-label" for="log_not_found">
<span class="info"><code>log_not_found</code></span>
</label>
</div>
<div class="form-check">
<input class="form-check-input" type="checkbox" id="limit_req" ng-model="data.limit_req">
<label class="form-check-label" for="limit_req">
<span class="info"><code>limit_req</code></span>
</label>
</div>
</div>
</div>
<div class="card">
<div class="card-body">
<div class="form-group">
<label class="form-label"><span class="info">css/js <code>expires</code></span></label>
<input type="text" class="form-control form-control-sm" ng-model="data.expires.css_js">
</div>
<div class="form-group">
<label class="form-label"><span class="info">media <code>expires</code></span></label>
<input type="text" class="form-control form-control-sm" ng-model="data.expires.media">
</div>
<div class="form-group">
<label class="form-label"><span class="info">svg <code>expires</code></span></label>
<input type="text" class="form-control form-control-sm" ng-model="data.expires.svg">
</div>
<div class="form-group">
<label class="form-label"><span class="info">font <code>expires</code></span></label>
<input type="text" class="form-control form-control-sm" ng-model="data.expires.font">
</div>
</div>
</div>
</div>
<div class="col-md-6 col-lg-8 files">
<div class="row">
<div class="file" ng-class="data.file_structure === 'separated' || (data.php !== 'off' && data.wordpress) ? 'col-xl-6' : 'col-xl-12'">
<strong>/etc/nginx/nginx.conf</strong>
<div class="code source">
<pre><code class="nginx" ng-include="'templates/nginx.conf.html'" onload="refreshHighlighting()"></code></pre>
</div><div class="code highlighted"></div>
</div>
<div class="col-xl-6 file" ng-if="data.file_structure === 'separated'">
<strong>/etc/nginx/sites-enabled/{{ data.domain }}.conf</strong>
<div class="code source">
<pre><code class="nginx" ng-include="'templates/example.com.conf.html'" onload="refreshHighlighting()"></code></pre>
</div><div class="code highlighted"></div>
</div>
<div class="col-xl-6 file" ng-if="data.https">
<strong>/etc/nginx/_ssl.conf</strong>
<div class="code source">
<pre><code class="nginx" ng-include="'templates/_ssl.conf.html'" onload="refreshHighlighting()"></code></pre>
</div><div class="code highlighted"></div>
</div>
<div class="col-xl-6 file" ng-if="data.https">
<strong>/etc/nginx/_letsencrypt.conf</strong>
<div class="code source">
<pre><code class="nginx" ng-include="'templates/_letsencrypt.conf.html'" onload="refreshHighlighting()"></code></pre>
</div><div class="code highlighted"></div>
</div>
<div class="col-xl-6 file" ng-if="data.file_structure === 'separated'">
<strong>/etc/nginx/_general.conf</strong>
<div class="code source">
<pre><code class="nginx" ng-include="'templates/_general.conf.html'" onload="refreshHighlighting()"></code></pre>
</div><div class="code highlighted"></div>
</div>
<div class="col-xl-6 file" ng-if="data.php !== 'off' && data.file_structure === 'separated'">
<strong>/etc/nginx/_php.conf</strong>
<div class="code source">
<pre><code class="nginx" ng-include="'templates/_php.conf.html'" onload="refreshHighlighting()"></code></pre>
</div><div class="code highlighted"></div>
</div>
<div class="col-xl-6 file" ng-if="data.php !== 'off' && (data.file_structure === 'separated' || (data.php !== 'off' && data.wordpress))">
<strong>/etc/nginx/_php_fastcgi.conf</strong>
<div class="code source">
<pre><code class="nginx" ng-include="'templates/_php_fastcgi.conf.html'" onload="refreshHighlighting()"></code></pre>
</div><div class="code highlighted"></div>
</div>
<div class="col-xl-6 file" ng-if="data.php !== 'off' && data.wordpress && data.file_structure === 'separated'">
<strong>/etc/nginx/_wordpress.conf</strong>
<div class="code source">
<pre><code class="nginx" ng-include="'templates/_wordpress.conf.html'" onload="refreshHighlighting()"></code></pre>
</div><div class="code highlighted"></div>
</div>
</div>
</div>
<div class="col-md-3 col-lg-2 sidebar">
<div class="adsbygoogle-container">
<ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-6543577519725877"
data-ad-slot="1857879957"
data-ad-format="auto"></ins>
<script>
(window.adsbygoogle = window.adsbygoogle || []).push({});
</script>
<div class="note">advertisement</div>
</div>
</div>
</div>
</div>
</main>
<footer>
<div class="container-fluid">
Lovingly made at <img src="assets/img/balaton.svg" alt="Lake Balaton" class="balaton"> <span class="text-muted">(Lake Balaton, Hungary)</span>
</div>
</footer>
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-3084378-31"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-3084378-31');
</script>
<script src="assets/js/highlight.min.js?v=9.12.0"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.7/angular.min.js"></script>
<script src="assets/js/app.js"></script>
</body>
</html>

View File

@ -0,0 +1,44 @@
# headers
add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-XSS-Protection "1; mode=block" always;
add_header X-Content-Type-Options "nosniff" always;
add_header X-UA-Compatible "IE=Edge" always;
add_header Cache-Control "no-transform" always;
# . files
location ~ /\.(?!well-known).* {
deny all;
}<span ng-if="data.expires.css_js !== '' && data.expires.css_js !== data.expires.media">
# css/js
location ~* \.(css|js)$ {
expires {{ data.expires.css_js }};<span ng-if="data.access_log !== ''">
access_log off;</span>
}</span><span ng-if="data.expires.media !== ''">
# {{ data.expires.css_js !== '' && data.expires.css_js === data.expires.media ? 'css/js, ' : '' }}media
location ~* \.({{ data.expires.css_js !== '' && data.expires.css_js === data.expires.media ? 'css|js|' : '' }}jpe?g|gif|png|heic|ico|cur|mp4|mov|ogg|ogv|webm|htc)$ {
expires {{ data.expires.media }};<span ng-if="data.access_log !== ''">
access_log off;</span>
}</span><span ng-if="data.expires.svg !== '' && data.expires.svg !== data.expires.font">
# svg
location ~* \.svg$ {
add_header Access-Control-Allow-Origin "*";
expires {{ data.expires.svg }};<span ng-if="data.access_log !== ''">
access_log off;</span>
}</span><span ng-if="data.expires.font !== ''">
# {{ data.expires.svg !== '' && data.expires.svg === data.expires.font ? 'svg, ' : '' }}fonts
location ~* \.({{ data.expires.svg !== '' && data.expires.svg === data.expires.font ? 'svg|' : '' }}ttf|ttc|otf|eot|woff|woff2)$ {
add_header Access-Control-Allow-Origin "*";
expires {{ data.expires.font }};<span ng-if="data.access_log !== ''">
access_log off;</span>
}</span>
<span ng-if="data.gzip">
# gzip
gzip on;
gzip_vary on;
gzip_proxied any;
gzip_comp_level 6;
gzip_types text/plain text/css text/xml application/json application/javascript application/xml+rss application/atom+xml image/svg+xml;</span>

View File

@ -0,0 +1,4 @@
location ^~ /.well-known/acme-challenge/ {
default_type "text/plain";
root /var/www/_letsencrypt;
}

View File

@ -0,0 +1,14 @@
# index
index {{ data.index_html ? 'index.html ' : '' }}index.php;
# process with {{ data.index_html ? 'index.html, ' : '' }}index.php
location / {
try_files $uri $uri/ {{ data.index_html ? '/index.html ' : '' }}/index.php?$query_string;
}
# handle .php
location ~ \.php$ {<span ng-if="data.file_structure === 'separated'">
include _php_fastcgi.conf;
</span><span ng-if="data.file_structure === 'unified'">
<ng-include src="'templates/_php_fastcgi.conf.html'" onload="refreshHighlighting()"></ng-include></span>
}

View File

@ -0,0 +1,23 @@
try_files $uri =404;
# fastcgi
fastcgi_pass {{
data.php === 'tcp' ? '127.0.0.1:9000' : (
data.php === '5.x' ? 'unix:/var/run/php5-fpm.sock' : (
'unix:/var/run/php/php' + data.php +'-fpm.sock'
)
)
}};
fastcgi_index index.php;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PHP_ADMIN_VALUE open_basedir=$base/:/usr/lib/php/:/tmp/;
fastcgi_intercept_errors off;
fastcgi_buffer_size 128k;
fastcgi_buffers 256 16k;
fastcgi_busy_buffers_size 256k;
fastcgi_temp_file_write_size 256k;
# default fastcgi_params
include fastcgi_params;

View File

@ -0,0 +1,24 @@
# https://mozilla.github.io/server-side-tls/ssl-config-generator/?server=nginx-1.10.3&openssl=1.1.0g&hsts=yes&profile=intermediate
ssl_session_timeout 1d;
ssl_session_cache shared:SSL:50m;
ssl_session_tickets off;
# Diffie-Hellman parameter for DHE ciphersuites
# openssl dhparam -dsaparam -out /etc/nginx/dhparam.pem 4096
ssl_dhparam /etc/nginx/dhparam.pem;
# intermediate configuration
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers 'ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS';
ssl_prefer_server_ciphers on;
# HSTS
add_header Strict-Transport-Security "max-age=15768000" always;
# OCSP Stapling
# fetch OCSP records from URL in ssl_certificate and cache them
ssl_stapling on;
ssl_stapling_verify on;
resolver 8.8.8.8 8.8.4.4 208.67.222.222 208.67.220.220 valid=60s;
resolver_timeout 2s;

View File

@ -0,0 +1,30 @@
# allow tinymce
location = /wp-includes/js/tinymce/wp-tinymce.php {
include _php_fastcgi.conf;
}
# wp-content, wp-includes php files
location ~* ^/(wp-content|wp-includes)/.*\.php$ {
deny all;
}
# wp-content/uploads nasty stuff
location ~* ^/wp-content/uploads/.*\.(html|htm|shtml|php|js|swf|css)$ {
deny all;
}
# wp-content/plugins nasty stuff
location ~* ^/wp-content/plugins/.*\.(?!jpe?g|gif|png|svg|heic|js|css) {
deny all;
}
# WordPress stuff
location ~* ^/(xmlrpc\.php|wp-config\.php|wp-config-sample\.php|wp-comments-post\.php|readme\.html|license\.txt)$ {
deny all;
}<span ng-if="data.limit_req">
# wp-login.php throttle
location = /wp-login.php {
limit_req zone=login burst=2 nodelay;
include _php_fastcgi.conf;
}</span>

View File

@ -0,0 +1,83 @@
<span ng-if="data.https"># certbot certonly --non-interactive --text --email {{ data.email }} --agree-tos --force-renew --webroot --webroot-path /var/www/_letsencrypt --domain {{ data.domain }} --domain www.{{ data.domain }}
server {
listen 443 ssl{{ data.http2 ? ' http2' : '' }};
listen [::]:443 ssl{{ data.http2 ? ' http2' : '' }};
server_name {{ !data.non_www ? 'www.' : '' }}{{ data.domain }};
set $base /var/www/{{ data.domain }};
root $base/public;
ssl_certificate /etc/letsencrypt/live/{{ data.domain }}/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/{{ data.domain }}/privkey.pem;
ssl_trusted_certificate /etc/letsencrypt/live/{{ data.domain }}/fullchain.pem;
<span ng-if="data.file_structure === 'separated'">
include _general.conf;<span ng-if="data.php !== 'off' && data.wordpress">
include _wordpress.conf;</span><span ng-if="data.php !== 'off'">
include _php.conf;</span>
include _letsencrypt.conf;
include _ssl.conf;</span><span ng-if="data.file_structure === 'unified'">
<ng-include src="'templates/_general.conf.html'" onload="refreshHighlighting()"></ng-include><span ng-if="data.php !== 'off' && data.wordpress">
<ng-include src="'templates/_wordpress.conf.html'" onload="refreshHighlighting()"></ng-include></span><span ng-if="data.php !== 'off'">
<ng-include src="'templates/_php.conf.html'" onload="refreshHighlighting()"></ng-include></span>
<ng-include src="'templates/_letsencrypt.conf.html'" onload="refreshHighlighting()"></ng-include>
include _ssl.conf;</span>
}
# https {{ !data.non_www ? 'domain, ' : '' }}subdomains redirect
server {
listen 443 ssl{{ data.http2 ? ' http2' : '' }};
listen [::]:443 ssl{{ data.http2 ? ' http2' : '' }};
server_name {{ !data.non_www ? data.domain + ' ' : '' }}*.{{ data.domain }};
ssl_certificate /etc/letsencrypt/live/{{ data.domain }}/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/{{ data.domain }}/privkey.pem;
ssl_trusted_certificate /etc/letsencrypt/live/{{ data.domain }}/fullchain.pem;
include _ssl.conf;
return 301 https://{{ !data.non_www ? 'www.' : '' }}{{ data.domain }}$request_uri;
}
# http redirect
server {
listen [::]:80;
listen 80;
server_name {{ data.domain }} *.{{ data.domain }};
<span ng-if="data.file_structure === 'separated'">
include _letsencrypt.conf;</span><span ng-if="data.file_structure === 'unified'">
<ng-include src="'templates/_letsencrypt.conf.html'" onload="refreshHighlighting()"></ng-include></span>
return 301 https://{{ !data.non_www ? 'www.' : '' }}{{ data.domain }}$request_uri;
}</span><span ng-if="!data.https">server {
listen [::]:80;
listen 80;
server_name {{ !data.non_www ? 'www.' : '' }}{{ data.domain }};
set $base /var/www/{{ data.domain }};
root $base/public;
<span ng-if="data.file_structure === 'separated'">
include _general.conf;<span ng-if="data.php !== 'off' && data.wordpress">
include _wordpress.conf;</span><span ng-if="data.php !== 'off'">
include _php.conf;</span></span><span ng-if="data.file_structure === 'unified'">
<ng-include src="'templates/_general.conf.html'" onload="refreshHighlighting()"></ng-include><span ng-if="data.php !== 'off' && data.wordpress">
<ng-include src="'templates/_wordpress.conf.html'" onload="refreshHighlighting()"></ng-include></span><span ng-if="data.php !== 'off'">
<ng-include src="'templates/_php.conf.html'" onload="refreshHighlighting()"></ng-include></span></span>
}
# {{ !data.non_www ? 'domain, ' : '' }}subdomains redirect
server {
listen 80;
listen [::]:80;
server_name {{ !data.non_www ? data.domain + ' ' : '' }}*.{{ data.domain }};
return 301 http://{{ !data.non_www ? 'www.' : '' }}{{ data.domain }}$request_uri;
}</span>

View File

@ -0,0 +1,41 @@
user {{ data.user }};
pid {{ data.pid}};
worker_processes {{ data.worker_processes }};
worker_rlimit_nofile 409600;
events {
worker_connections 4096;
multi_accept on;
use epoll;
}
http {
charset utf-8;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
types_hash_max_size 2048;<span ng-if="!data.server_tokens">
server_tokens off;</span><span ng-if="!data.log_not_found">
log_not_found off;</span>
client_max_body_size 50M;
client_body_buffer_size 128k;
# mime
include mime.types;
default_type application/octet-stream;
# logging<span ng-if="data.access_log !== ''">
access_log {{ data.access_log }};</span>
error_log {{ data.error_log }} warn;<span ng-if="data.limit_req">
# limits
limit_req_log_level warn;
limit_req_zone $binary_remote_addr zone=login:10m rate=10r/m;</span>
# include configs
include /etc/nginx/conf.d/*.conf;<span ng-if="data.file_structure === 'separated'">
include /etc/nginx/sites-enabled/*;</span><span ng-if="data.file_structure === 'unified'">
<ng-include src="'templates/example.com.conf.html'" onload="refreshHighlighting()"></ng-include></span>
}