Browse Source

adding bugfix

release/0.1
Björn 4 years ago
parent
commit
1483c40fb7
6 changed files with 57 additions and 14 deletions
  1. +4
    -4
      app/Factories/NginxVhostFactory.php
  2. +2
    -2
      resources/nginx/templates/flight.blade.php
  3. +26
    -1
      resources/nginx/templates/laravel.blade.php
  4. +4
    -1
      resources/nginx/templates/layouts/ssl.blade.php
  5. +21
    -1
      resources/nginx/templates/php.blade.php
  6. +0
    -5
      resources/nginx/templates/reverse-proxy.blade.php

+ 4
- 4
app/Factories/NginxVhostFactory.php View File

@ -91,12 +91,12 @@ class NginxVhostFactory
->disableDefaultItems()
// edit configuration
->addItem('edit', function(CliMenu $menu) use ($vhost) {
->addItem('edit', function(CliMenu $menu) use (&$vhost) {
system('nano /etc/nginx/sites-available/'.$vhost['file'].' > `tty`');
})
// delete configuration
->addItem('delete', function(CliMenu $menu) use ($vhost) {
->addItem('delete', function(CliMenu $menu) use (&$vhost) {
if ($vhost['enabled'] === true) {
$menu->flash('Please disable first!')->display();
@ -166,10 +166,10 @@ class NginxVhostFactory
* @param [type] $vhost
* @return [type]
*/
private function createVhostCheckbox($vhost)
private function createVhostCheckbox(&$vhost)
{
// create checkbox for enabled / disabled
$checkbox = new CheckboxItem('enabled', function(CliMenu $menu) use ($vhost) {
$checkbox = new CheckboxItem('enabled', function(CliMenu $menu) use (&$vhost) {
// check status
if ($menu->getSelectedItem()->getChecked()) {


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

@ -6,13 +6,13 @@
index {{ $index }};
location / {
try_files $uri $uri/ /index.php;
try_files $uri $uri/ /{{ $index }};
}
# php-fpm configuration.
location ~ \.php(/|$) {
fastcgi_split_path_info ^(.+\.php)(.*)$;
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
fastcgi_pass unix:/var/run/php/{{ $phpFpm }}.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
fastcgi_param DOCUMENT_ROOT $realpath_root;


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

@ -1 +1,26 @@
@extends($ssl ? 'layouts.ssl' : 'layouts.no-ssl')
@extends($ssl ? 'layouts.ssl' : 'layouts.no-ssl')
@section('server')
root {{ $root }};
index {{ $index }};
location / {
try_files $uri $uri/ /{{ $index }}?$query_string;
}
location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
error_page 404 /index.php;
# php-fpm configuration.
location ~ \.php(/|$) {
fastcgi_split_path_info ^(.+\.php)(.*)$;
fastcgi_pass unix:/var/run/php/{{ $phpFpm }}.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

+ 4
- 1
resources/nginx/templates/layouts/ssl.blade.php View File

@ -13,7 +13,7 @@ server {
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/snippets/ssl-params.conf;
include /etc/nginx/snippets/secure-headers.conf;
server_name www.{{ $domain }};
@ -28,6 +28,9 @@ server {
ssl_certificate /etc/letsencrypt/live/{{ $domain }}/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/{{ $domain }}/privkey.pem;
include /etc/nginx/snippets/snippets/ssl-params.conf;
include /etc/nginx/snippets/secure-headers.conf;
add_header Content-Security-Policy "
default-src 'self';
font-src 'self';


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

@ -1 +1,21 @@
@extends($ssl ? 'layouts.ssl' : 'layouts.no-ssl')
@extends($ssl ? 'layouts.ssl' : 'layouts.no-ssl')
@section('server')
root {{ $root }};
index {{ $index }};
location / {
try_files $uri $uri/ /{{ $index }};
}
# php-fpm configuration.
location ~ \.php(/|$) {
fastcgi_split_path_info ^(.+\.php)(.*)$;
fastcgi_pass unix:/var/run/php/{{ $phpFpm }}.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

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

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

Loading…
Cancel
Save