Browse Source

adding nginx

release/0.1
Björn 4 years ago
parent
commit
e075a04b81
22 changed files with 565 additions and 144 deletions
  1. +3
    -31
      README.md
  2. +202
    -110
      app/Commands/NginxVhostsCommand.php
  3. +2
    -2
      app/Facades/NginxVhost.php
  4. +1
    -1
      app/Helpers/NginxVhostHelper.php
  5. +0
    -0
      resources/nginx/templates/.gitkeep
  6. +10
    -0
      resources/nginx/templates/flight.blade.php
  7. +1
    -0
      resources/nginx/templates/laravel.blade.php
  8. +16
    -0
      resources/nginx/templates/layouts/no-ssl.blade.php
  9. +44
    -0
      resources/nginx/templates/layouts/ssl.blade.php
  10. +9
    -0
      resources/nginx/templates/partials/default.blade.php
  11. +1
    -0
      resources/nginx/templates/php.blade.php
  12. +5
    -0
      resources/nginx/templates/reverse-proxy.blade.php
  13. +45
    -0
      resources/nginx/templates/wordpress.blade.php
  14. +9
    -0
      storage/cache/887379cb96b8427d61aa39b73678b202900cb648.php
  15. +7
    -0
      storage/cache/8f3a641a10e5f3da2806ddee53e0522e9158ee7b.php
  16. +44
    -0
      storage/cache/97f5c7f4e7eb0830bf2cbb7d8c98c9e7e3eda420.php
  17. +44
    -0
      storage/cache/b8be4cd44c7bf959a77084ac66540007a10ae7f2.php
  18. +16
    -0
      storage/cache/c25fb649a0065d8271813d9667d51f50825d6579.php
  19. +9
    -0
      storage/cache/d3faad602c007cdd0b7e6f2115872a4a74a46e03.php
  20. +44
    -0
      storage/cache/db33776c0af644e989accce92812804c9542ae25.php
  21. +9
    -0
      storage/cache/ea3cb35f6a6aa916c3116d6254ed92e718b1cafb.php
  22. +44
    -0
      storage/cache/f759350e6c9ffc48e248d8248ac6e8cc234e8172.php

+ 3
- 31
README.md View File

@ -1,37 +1,9 @@
<p align="center">
<img title="Laravel Zero" height="100" src="https://raw.githubusercontent.com/laravel-zero/docs/master/images/logo/laravel-zero-readme.png" />
</p>
<p align="center">
<a href="https://github.com/laravel-zero/framework/actions"><img src="https://img.shields.io/github/workflow/status/laravel-zero/framework/Continuous%20Integration.svg" alt="Build Status"></img></a>
<a href="https://scrutinizer-ci.com/g/laravel-zero/framework"><img src="https://img.shields.io/scrutinizer/g/laravel-zero/framework.svg" alt="Quality Score"></img></a>
<a href="https://packagist.org/packages/laravel-zero/framework"><img src="https://poser.pugx.org/laravel-zero/framework/d/total.svg" alt="Total Downloads"></a>
<a href="https://packagist.org/packages/laravel-zero/framework"><img src="https://poser.pugx.org/laravel-zero/framework/v/stable.svg" alt="Latest Stable Version"></a>
<a href="https://packagist.org/packages/laravel-zero/framework"><img src="https://poser.pugx.org/laravel-zero/framework/license.svg" alt="License"></a>
</p>
<h4> <center>This is a <bold>community project</bold> and not an official Laravel one </center></h4>
Laravel Zero was created by, and is maintained by [Nuno Maduro](https://github.com/nunomaduro), and is a micro-framework that provides an elegant starting point for your console application. It is an **unofficial** and customized version of Laravel optimized for building command-line applications.
- Built on top of the [Laravel](https://laravel.com) components.
- Optional installation of Laravel [Eloquent](https://laravel-zero.com/docs/database/), Laravel [Logging](https://laravel-zero.com/docs/logging/) and many others.
- Supports interactive [menus](https://laravel-zero.com/docs/build-interactive-menus/) and [desktop notifications](https://laravel-zero.com/docs/send-desktop-notifications/) on Linux, Windows & MacOS.
- Ships with a [Scheduler](https://laravel-zero.com/docs/task-scheduling/) and a [Standalone Compiler](https://laravel-zero.com/docs/build-a-standalone-application/).
- Integration with [Collision](https://github.com/nunomaduro/collision) - Beautiful error reporting
------
# MCP
## Documentation
For full documentation, visit [laravel-zero.com](https://laravel-zero.com/).
## Support the development
**Do you like this project? Support it by donating**
- PayPal: [Donate](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=66BYDWAT92N6L)
- Patreon: [Donate](https://www.patreon.com/nunomaduro)
## Contribute
## License
Laravel Zero is an open-source software licensed under the [MIT license](https://github.com/laravel-zero/laravel-zero/blob/stable/LICENSE.md).
MCP is an open-source software licensed under the [MIT license](https://github.com/laravel-zero/laravel-zero/blob/stable/LICENSE.md).

+ 202
- 110
app/Commands/NginxVhostsCommand.php View File

@ -5,8 +5,10 @@ namespace App\Commands;
use Illuminate\Console\Scheduling\Schedule;
use LaravelZero\Framework\Commands\Command;
use Illuminate\Support\Facades\File;
use Jenssegers\Blade\Blade;
use App\Facades\Install;
use App\Facades\NginxVhost;
use PhpSchool\CliMenu\Builder\CliMenuBuilder;
use PhpSchool\CliMenu\CliMenu;
@ -14,11 +16,12 @@ use PhpSchool\CliMenu\MenuItem\CheckboxItem;
use PhpSchool\CliMenu\Style\SelectableStyle;
use Log;
use Closure;
class NginxVhostsCommand extends Command
{
// path templates
const TEMPLATES_DIR = '/resources/templates/nginx';
const TEMPLATES_DIR = '/resources/nginx/templates';
/**
* The signature of the command.
@ -39,138 +42,227 @@ class NginxVhostsCommand extends Command
*
*
*/
private function add(CliMenuBuilder $builder)
private function getTemplates($prefix = '')
{
// templates
$templates = [];
// getting templates
$files = scandir(base_path().self::TEMPLATES_DIR);
foreach($files as $file) {
// create filepath
$filepath = base_path().self::TEMPLATES_DIR.'/'.$file;
// getting info
$pathinfo = pathinfo($filepath);
// if extension isset and php
if (isset($pathinfo['extension']) && $pathinfo['extension'] === 'php') {
$name = str_replace('.blade.php', '', $file);
$templates[] = [
'name' => $name,
'file' => $file,
'filepath' => $filepath
];
}
}
return $templates;
}
/**
* Execute the console command.
*
* @return mixed
*
*
*/
public function handle()
private function selectTemplate()
{
// create menu
$main = $this->menu(self::MENU_TITLE)
->addSubMenu('add', function(CliMenuBuilder $builder) {
// getting templates
$templates = scandir(base_path().self::TEMPLATES_DIR);
foreach($templates as $template) {
$builder
->addSubMenu($template, function(CliMenuBuilder $builder) use ($template) {
$configuration = [
'domain' => '',
'ssl' => true,
'redirect_www' => true
];
$checkboxSSL = new CheckboxItem('ssl', function(CliMenu $menu) use (&$configuration) {
$configuration['ssl'] = $menu->getSelectedItem()->getChecked();
});
$checkboxSSL->setChecked($configuration['ssl']);
$checkboxRedirect = new CheckboxItem('redirect www', function(CliMenu $menu) use (&$configuration) {
$configuration['redirect www'] = $menu->getSelectedItem()->getChecked();
});
$checkboxRedirect->setChecked($configuration['redirect_www']);
$builder
->setTitle('Nginx Vhosts > add > '.$template)
->addItem('domain', function(CliMenu $menu) use (&$configuration) {
$result = $menu->askText()->ask();
$configuration['domain'] = $result->fetch();
$menu->getSelectedItem()->setText('domain -> '.$result->fetch());
$menu->redraw();
})
->addLineBreak('-')
->addMenuItem($checkboxSSL)
->addMenuItem($checkboxRedirect)
->addLineBreak('-')
->addItem('save', function() use (&$configuration) {
var_dump($configuration);
})
->addLineBreak('-');
});
}
// getting templates
$templates = $this->getTemplates();
$menu = function(CliMenuBuilder $builder) use ($templates)
{
// writing configuration
$blade = new Blade(base_path().self::TEMPLATES_DIR, base_path().'/storage/cache');
$builder
->setTitle('Nginx > add')
->setGoBackButtonText('Back');
foreach($templates as $template) {
$submenuCallable = $this->createConfiguration($template, $blade);
$builder
->addSubMenu($template['name'], $submenuCallable);
}
//exec('touch /etc/nginx/sites-available/');
})
->addLineBreak('-');
$builder->addLineBreak('-');
};
/***
return $menu;
}
$itemCallable = function(CliMenu $menu) {
/**
*
*
* @param [type] $template [description]
* @param [type] $blade [description]
* @return [type] [description]
*/
private function createConfiguration($template, $blade)
{
$menu = function(CliMenuBuilder $builder) use ($template, $blade)
{
$configuration = [
'domain' => '',
'root' => '',
'index' => 'index.php',
'ssl' => true,
'redirect_www' => true
];
// create checkbox for ssl
$checkboxSSL = new CheckboxItem('ssl', function(CliMenu $menu) use (&$configuration) {
$configuration['ssl'] = $menu->getSelectedItem()->getChecked();
});
$checkboxSSL->setChecked($configuration['ssl']);
// create checkbox for redirect from www
$checkboxRedirect = new CheckboxItem('redirect www', function(CliMenu $menu) use (&$configuration) {
$configuration['redirect_www'] = $menu->getSelectedItem()->getChecked();
});
$checkboxRedirect->setChecked($configuration['redirect_www']);
$builder
->setTitle('Nginx Vhosts > add > '.$template['name'])
->addItem('domain', function(CliMenu $menu) use (&$configuration) {
$result = $menu->askText()->ask();
$configuration['domain'] = $result->fetch();
$menu->getSelectedItem()->setText('domain -> '.$result->fetch());
$menu->redraw();
})
->addItem('root', function(CliMenu $menu) use (&$configuration) {
$result = $menu->askText()->ask();
$configuration['root'] = $result->fetch();
$menu->getSelectedItem()->setText('root -> '.$result->fetch());
$menu->redraw();
})
->addItem($configuration['index'], function(CliMenu $menu) use (&$configuration) {
$result = $menu->askText()->ask();
$configuration['index'] = $result->fetch();
$menu->getSelectedItem()->setText($result->fetch());
$menu->redraw();
})
->addLineBreak('-')
->addMenuItem($checkboxSSL)
->addMenuItem($checkboxRedirect)
->addLineBreak('-')
->addItem('save', function() use (&$configuration, $template, $blade) {
$content = $blade->render($template['name'], $configuration);
file_put_contents('/etc/nginx/sites-available/'.$configuration['domain'].'.conf', $content);
})
->addLineBreak('-');
};
return $menu;
}
// getting sites-available
$sitesAvailable = scandir('/etc/nginx/sites-available');
/**
* create submenu for vhost
*
*
* @param array $vhost
* @return CliMenuBuilder
*
*/
private function vhost($vhost)
{
$menu = function(CliMenuBuilder $builder) use ($vhost)
{
$checkbox = new CheckboxItem('enabled', function(CliMenu $menu) use ($vhost) {
// check status
if ($menu->getSelectedItem()->getChecked()) {
symlink('/etc/nginx/sites-available/'.$vhost['file'], '/etc/nginx/sites-enabled/'.$vhost['file']);
$status = 'enabled';
} else {
unlink('/etc/nginx/sites-enabled/'.$vhost['file']);
$status = 'disabled';
}
// getting sites-endabled
$sitesEnabled = scandir('/etc/nginx/sites-enabled');
// restart
exec('service nginx restart');
exec('service nginx status', $output);
foreach($sitesAvailable as $site) {
if ($site !== '.' && $site !== '..') {
if (strpos(implode(' ', $output), 'active') !== false) {
$menu->confirm($vhost['domain'].' is '.$status.'!')->display('OK!');
} else {
$menu->confirm('Error! Something not working!')->display('OK!');
}
// getting title
$title = str_replace('.conf', '', $site);
});
$checkbox = new CheckboxItem('enabled', function(CliMenu $menu) use ($site, $title) {
// adding checkbox
if ($vhost['enabled']) {
$checkbox->setChecked(true);
}
// check status
if ($menu->getSelectedItem()->getChecked()) {
symlink('/etc/nginx/sites-available/'.$site, '/etc/nginx/sites-enabled/'.$site);
$status = 'enabled';
} else {
unlink('/etc/nginx/sites-enabled/'.$site);
$status = 'disabled';
}
$builder
->setTitle('Nginx > '.$vhost['domain'])
->setGoBackButtonText('Back')
->addItem('edit', function(CliMenu $menu) use ($vhost) {
system('nano /etc/nginx/sites-available/'.$vhost['file'].' > `tty`');
})
->addItem('delete', function(CliMenu $menu) use ($vhost) {
if (file_exists('/etc/nginx/sites-enabled/'.$vhost['file'])) {
$menu->confirm('Error! Please disable '.$vhost['domain'].' first!')->display('OK!');
} else {
unlink('/etc/nginx/sites-available/'.$vhost['file']);
$menu->confirm($vhost['domain'].' is deleted!')->display('OK!');
}
})
->addLineBreak('-')
->addMenuItem($checkbox)
->addLineBreak('-');
};
// starting
exec('service nginx restart');
exec('service nginx status', $output);
return $menu;
}
if (strpos(implode(' ', $output), 'active') !== false) {
$menu->confirm($title.' is '.$status.'!')->display('OK!');
} else {
$menu->confirm('Error! Something not working!')->display('OK!');
}
/**
* let it rain
*
*
*/
public function handle()
{
$submenuSelectTemplate = $this->selectTemplate();
});
// create menu
$main = $this->menu('Nginx')
// adding checkbox
if (in_array($site, $sitesEnabled)) {
$checkbox->setChecked(true);
}
// add Submenu for select templates
->addSubMenu('add', $submenuSelectTemplate)
->addLineBreak('-');
$menuMain
->addSubmenu($title, function(CliMenuBuilder $builder) use ($site, $title, $checkbox) {
$builder->setTitle("Nginx > $title")
->addItem('edit', function(CliMenu $menu) use ($site, $title) {
system('nano /etc/nginx/sites-available/'.$site.' > `tty`');
})
->addItem('delete', function(CliMenu $menu) use ($site) {
if (file_exists('/etc/nginx/sites-enabled/'.$site)) {
$menu->confirm('Error! Please disable '.$title.' first!')->display('OK!');
} else {
unlink('/etc/nginx/sites-available/'.$site);
$menu->confirm("$site is deleted!")->display('OK!');
}
})
->addLineBreak('-')
->addMenuItem($checkbox)
->addLineBreak('-');
});
// getting vhosts
$vhosts = NginxVhost::find();
}
}
};*/
// add submenu for each vhost
foreach($vhosts as $vhost) {
$submenuEditVhost = $this->vhost($vhost);
$main->addSubMenu($vhost['domain'], $submenuEditVhost);
}
$main->addLineBreak('-')->open();
$main->addLineBreak('-');
$main->open();
}
}

app/Facades/Nginx.php → app/Facades/NginxVhost.php View File

@ -11,10 +11,10 @@ use Illuminate\Support\Facades\Facade;
* @license http://opensource.org/licenses/MIT The MIT License
* @link https://github.com/nirgendswo/fuzzy-cms GitHub Repository
*/
class Nginx extends Facade
class NginxVhost extends Facade
{
protected static function getFacadeAccessor()
{
return 'App\Helpers\NginxHelper';
return 'App\Helpers\NginxVhostHelper';
}
}

app/Helpers/NginxConfigurationHelper.php → app/Helpers/NginxVhostHelper.php View File

@ -8,7 +8,7 @@ namespace App\Helpers;
*
*
*/
class NginxHelper
class NginxVhostHelper
{
// path for available files
const SITES_AVAILABLE = '/etc/nginx/sites-available';

+ 0
- 0
resources/nginx/templates/.gitkeep View File


+ 10
- 0
resources/nginx/templates/flight.blade.php View File

@ -0,0 +1,10 @@
@extends($ssl ? 'layouts.ssl' : 'layouts.no-ssl')
@section('server')
root {{ $root }};
index {{ $index }};
location / {
try_files $uri $uri/ /index.php;
}
@endsection

+ 1
- 0
resources/nginx/templates/laravel.blade.php View File

@ -0,0 +1 @@
@extends($ssl ? 'layouts.ssl' : 'layouts.no-ssl')

+ 16
- 0
resources/nginx/templates/layouts/no-ssl.blade.php View File

@ -0,0 +1,16 @@
server {
listen 80;
listen [::]:80;
server_name {{ $domain }} @if ($redirect_www) www.{{ $domain }} @endif;
return 301 http://{{ $domain }}$request_uri;
}
server {
listen 80;
listen [::]:80;
@include('partials.default', ['domain' => $domain])
@section('server')
@show
}

+ 44
- 0
resources/nginx/templates/layouts/ssl.blade.php View File

@ -0,0 +1,44 @@
server {
listen 80;
listen [::]:80;
server_name {{ $domain }} @if ($redirect_www) www.{{ $domain }} @endif;
return 301 https://{{ $domain }}$request_uri;
}
@if ($redirect_www)
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
ssl_certificate /etc/letsencrypt/live/www.{{ $domain }}/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/www.{{ $domain }}/privkey.pem;
include snippets/ssl-params.conf;
include /etc/nginx/snippets/secure-headers.conf;
server_name www.{{ $domain }};
return 301 https://{{ $domain }}$request_uri;
}
@endif
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
ssl_certificate /etc/letsencrypt/live/{{ $domain }}/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/{{ $domain }}/privkey.pem;
add_header Content-Security-Policy "
default-src 'self';
font-src 'self';
style-src 'self';
img-src 'self';
base-uri 'self';
form-action 'self';
frame-ancestors 'self';
";
@include('partials.default', ['domain' => $domain])
@yield('server')
}

+ 9
- 0
resources/nginx/templates/partials/default.blade.php View File

@ -0,0 +1,9 @@
server_name {{ $domain }};
# include snippets
include /etc/nginx/snippets/deny.conf;
include /etc/nginx/snippets/expires.conf;
# logs
access_log /var/log/nginx/{{ $domain }}.access.log;
error_log /var/log/nginx/{{ $domain }}.error.log;

+ 1
- 0
resources/nginx/templates/php.blade.php View File

@ -0,0 +1 @@
@extends($ssl ? 'layouts.ssl' : 'layouts.no-ssl')

+ 5
- 0
resources/nginx/templates/reverse-proxy.blade.php View File

@ -0,0 +1,5 @@
@extends($ssl ? 'layouts.ssl' : 'layouts.no-ssl')
@section('server')
@endsection

+ 45
- 0
resources/nginx/templates/wordpress.blade.php View File

@ -0,0 +1,45 @@
@extends($ssl ? 'layouts.ssl' : 'layouts.no-ssl')
@section('server')
root {{ $root }};
index {{ $index }};
# rewrite
location / {
try_files $uri $uri/ /index.php?$args;
}
location = /favicon.ico {
log_not_found off;
access_log off;
}
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
expires max;
log_not_found off;
}
location ~ /\. {
deny all;
}
location ~* /(?:uploads|files)/.*\.php$ {
deny all;
}
# php-fpm configuration.
location ~ \.php(/|$) {
fastcgi_split_path_info ^(.+\.php)(.*)$;
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
fastcgi_param DOCUMENT_ROOT $realpath_root;
include /etc/nginx/fastcgi_params;
}
@endsection

+ 9
- 0
storage/cache/887379cb96b8427d61aa39b73678b202900cb648.php View File

@ -0,0 +1,9 @@
server_name <?php echo e($domain); ?>;
# include snippets
include /etc/nginx/snippets/deny.conf;
include /etc/nginx/snippets/expires.conf;
# logs
access_log /var/log/nginx/<?php echo e($domain); ?>.access.log;
error_log /var/log/nginx/<?php echo e($domain); ?>.error.log;<?php /**PATH /home/test/Workspace/tentakelfabrik/mcp/resources/templates/nginx/partials/default.blade.php ENDPATH**/ ?>

+ 7
- 0
storage/cache/8f3a641a10e5f3da2806ddee53e0522e9158ee7b.php View File

@ -0,0 +1,7 @@
server {
location / {
try_files $uri $uri/ /index.php;
}
}
<?php /**PATH /home/test/Workspace/tentakelfabrik/mcp/resources/templates/nginx/flight.blade.php ENDPATH**/ ?>

+ 44
- 0
storage/cache/97f5c7f4e7eb0830bf2cbb7d8c98c9e7e3eda420.php View File

@ -0,0 +1,44 @@
server {
listen 80;
listen [::]:80;
server_name <?php echo e($domain); ?> <?php if($redirect_www): ?> www.<?php echo e($domain); ?> <?php endif; ?>;
return 301 https://<?php echo e($domain); ?>$request_uri;
}
<?php if($redirect_www): ?>
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
ssl_certificate /etc/letsencrypt/live/www.<?php echo e($domain); ?>/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/www.<?php echo e($domain); ?>/privkey.pem;
include snippets/ssl-params.conf;
include /etc/nginx/snippets/secure-headers.conf;
server_name www.<?php echo e($domain); ?>;
return 301 https://<?php echo e($domain); ?>$request_uri;
}
<?php endif; ?>
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
ssl_certificate /etc/letsencrypt/live/<?php echo e($domain); ?>/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/<?php echo e($domain); ?>/privkey.pem;
add_header Content-Security-Policy "
default-src 'self';
font-src 'self';
style-src 'self';
img-src 'self';
base-uri 'self';
form-action 'self';
frame-ancestors 'self';
";
<?php echo $__env->make('partials.default', ['domain' => $domain], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
<?php echo $__env->yieldContent('server'); ?>
}<?php /**PATH /home/test/Workspace/tentakelfabrik/mcp/resources/nginx/templates/layouts/ssl.blade.php ENDPATH**/ ?>

+ 44
- 0
storage/cache/b8be4cd44c7bf959a77084ac66540007a10ae7f2.php View File

@ -0,0 +1,44 @@
<?php $__env->startSection('server'); ?>
root <?php echo e($root); ?>;
index <?php echo e($index); ?>;
# rewrite
location / {
try_files $uri $uri/ /index.php?$args;
}
location = /favicon.ico {
log_not_found off;
access_log off;
}
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
expires max;
log_not_found off;
}
location ~ /\. {
deny all;
}
location ~* /(?:uploads|files)/.*\.php$ {
deny all;
}
# php-fpm configuration.
location ~ \.php(/|$) {
fastcgi_split_path_info ^(.+\.php)(.*)$;
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
fastcgi_param DOCUMENT_ROOT $realpath_root;
include /etc/nginx/fastcgi_params;
}
<?php $__env->stopSection(); ?>
<?php echo $__env->make($ssl ? 'layouts.ssl' : 'layouts.no-ssl', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/test/Workspace/tentakelfabrik/mcp/resources/templates/nginx/wordpress.blade.php ENDPATH**/ ?>

+ 16
- 0
storage/cache/c25fb649a0065d8271813d9667d51f50825d6579.php View File

@ -0,0 +1,16 @@
server {
listen 80;
listen [::]:80;
server_name <?php echo e($domain); ?> <?php if($redirect_www): ?> www.<?php echo e($domain); ?> <?php endif; ?>;
return 301 http://<?php echo e($domain); ?>$request_uri;
}
server {
listen 80;
listen [::]:80;
<?php echo $__env->make('partials.default', ['domain' => $domain], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
<?php $__env->startSection('server'); ?>
<?php echo $__env->yieldSection(); ?>
}<?php /**PATH /home/test/Workspace/tentakelfabrik/mcp/resources/templates/nginx/layouts/no-ssl.blade.php ENDPATH**/ ?>

+ 9
- 0
storage/cache/d3faad602c007cdd0b7e6f2115872a4a74a46e03.php View File

@ -0,0 +1,9 @@
server_name <?php echo e($domain); ?>;
# include snippets
include /etc/nginx/snippets/deny.conf;
include /etc/nginx/snippets/expires.conf;
# logs
access_log /var/log/nginx/<?php echo e($domain); ?>.access.log;
error_log /var/log/nginx/<?php echo e($domain); ?>.error.log;<?php /**PATH /home/test/Workspace/tentakelfabrik/mcp/resources/nginx/templates/partials/default.blade.php ENDPATH**/ ?>

+ 44
- 0
storage/cache/db33776c0af644e989accce92812804c9542ae25.php View File

@ -0,0 +1,44 @@
server {
listen 80;
listen [::]:80;
server_name <?php echo e($domain); ?> <?php if($redirect_www): ?> www.<?php echo e($domain); ?> <?php endif; ?>;
return 301 https://<?php echo e($domain); ?>$request_uri;
}
<?php if($redirect_www): ?>
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
ssl_certificate /etc/letsencrypt/live/www.<?php echo e($domain); ?>/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/www.<?php echo e($domain); ?>/privkey.pem;
include snippets/ssl-params.conf;
include /etc/nginx/snippets/secure-headers.conf;
server_name www.<?php echo e($domain); ?>;
return 301 https://<?php echo e($domain); ?>$request_uri;
}
<?php endif; ?>
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
ssl_certificate /etc/letsencrypt/live/<?php echo e($domain); ?>/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/<?php echo e($domain); ?>/privkey.pem;
add_header Content-Security-Policy "
default-src 'self';
font-src 'self';
style-src 'self';
img-src 'self';
base-uri 'self';
form-action 'self';
frame-ancestors 'self';
";
<?php echo $__env->make('partials.default', ['domain' => $domain], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
<?php echo $__env->yieldContent('server'); ?>
}<?php /**PATH /home/test/Workspace/tentakelfabrik/mcp/resources/templates/nginx/layouts/ssl.blade.php ENDPATH**/ ?>

+ 9
- 0
storage/cache/ea3cb35f6a6aa916c3116d6254ed92e718b1cafb.php View File

@ -0,0 +1,9 @@
<?php $__env->startSection('server'); ?>
root <?php echo e($root); ?>;
index <?php echo e($index); ?>;
location / {
try_files $uri $uri/ /index.php;
}
<?php $__env->stopSection(); ?>
<?php echo $__env->make($ssl ? 'layouts.ssl' : 'layouts.no-ssl', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/test/Workspace/tentakelfabrik/mcp/resources/nginx/templates/flight.blade.php ENDPATH**/ ?>

+ 44
- 0
storage/cache/f759350e6c9ffc48e248d8248ac6e8cc234e8172.php View File

@ -0,0 +1,44 @@
<?php $__env->startSection('server'); ?>
root <?php echo e($root); ?>;
index <?php echo e($index); ?>;
# rewrite
location / {
try_files $uri $uri/ /index.php?$args;
}
location = /favicon.ico {
log_not_found off;
access_log off;
}
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
expires max;
log_not_found off;
}
location ~ /\. {
deny all;
}
location ~* /(?:uploads|files)/.*\.php$ {
deny all;
}
# php-fpm configuration.
location ~ \.php(/|$) {
fastcgi_split_path_info ^(.+\.php)(.*)$;
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
fastcgi_param DOCUMENT_ROOT $realpath_root;
include /etc/nginx/fastcgi_params;
}
<?php $__env->stopSection(); ?>
<?php echo $__env->make($ssl ? 'layouts.ssl' : 'layouts.no-ssl', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/test/Workspace/tentakelfabrik/mcp/resources/nginx/templates/wordpress.blade.php ENDPATH**/ ?>

Loading…
Cancel
Save