Commit 42c884e1 authored by w4t's avatar w4t

wtserver 0.50

parent 147cb27f
...@@ -17,16 +17,20 @@ InstallCloud() { ...@@ -17,16 +17,20 @@ InstallCloud() {
;; ;;
esac esac
# Generate SSL certificate # Stop Nginx to configure SSL
systemctl stop nginx systemctl stop nginx
if [ "$CFG_SSL_NEW" == "yes" ]; then if [ "$CFG_SSL_NEW" == "yes" ]; then
sh /root/.acme.sh/acme.sh --issue --standalone -d cloud.$CFG_HOSTNAME_DOMAIN --force >> $PROGRAMS_INSTALL_LOG_FILES 2>&1 sh /root/$SUDO_USER/.acme.sh/acme.sh --issue --standalone -d cloud.$CFG_HOSTNAME_DOMAIN --force >> $PROGRAMS_INSTALL_LOG_FILES 2>&1
else else
#cp -av /home/administrator/wtlinux_server_setup/acme_ssl/arbajnok/cloud.$CFG_HOSTNAME_DOMAIN ~/.acme.sh/ cp -av /home/$SUDO_USER/wtlinux_server_setup/acme_ssl/$CFG_HOSTNAME_DOMAIN/cloud.$CFG_HOSTNAME_DOMAIN /home/$SUDO_USER/.acme.sh/ >> $PROGRAMS_INSTALL_LOG_FILES 2>&1
cp -av /home/$SUDO_USER/wtlinux_server_setup/acme_ssl/$CFG_HOSTNAME_DOMAIN/cloud.$CFG_HOSTNAME_DOMAIN /root/.acme.sh/ >> $PROGRAMS_INSTALL_LOG_FILES 2>&1
fi fi
systemctl restart nginx # Restart the appropriate web server
if [[ "$CFG_WEBSERVER" == "apache" ]]; then
service apache2 restart >> $PROGRAMS_INSTALL_LOG_FILES 2>&1
else
service nginx restart >> $PROGRAMS_INSTALL_LOG_FILES 2>&1
fi
# Save configuration details # Save configuration details
cat >> /home/$SUDO_USER/wtlinux_server_setup/wtserver_configuration.txt <<EOF cat >> /home/$SUDO_USER/wtlinux_server_setup/wtserver_configuration.txt <<EOF
...@@ -593,7 +597,6 @@ server { ...@@ -593,7 +597,6 @@ server {
} }
server { server {
# listen 80;
listen 443 ssl http2; listen 443 ssl http2;
server_name cloud.$CFG_HOSTNAME_DOMAIN; server_name cloud.$CFG_HOSTNAME_DOMAIN;
...@@ -657,7 +660,7 @@ server { ...@@ -657,7 +660,7 @@ server {
error_page 404 /core/templates/404.php; error_page 404 /core/templates/404.php;
location / { location / {
rewrite ^ /index.php\$uri; try_files $uri $uri/ /index.php$request_uri;
} }
location ~ ^/(?:build|tests|config|lib|3rdparty|templates|data)/ { location ~ ^/(?:build|tests|config|lib|3rdparty|templates|data)/ {
...@@ -675,7 +678,7 @@ server { ...@@ -675,7 +678,7 @@ server {
#Avoid sending the security headers twice #Avoid sending the security headers twice
fastcgi_param modHeadersAvailable true; fastcgi_param modHeadersAvailable true;
fastcgi_param front_controller_active true; fastcgi_param front_controller_active true;
fastcgi_pass unix:/run/php/php7.3-fpm.sock; fastcgi_pass unix:/run/php/php7.2-fpm.sock;
fastcgi_intercept_errors on; fastcgi_intercept_errors on;
fastcgi_request_buffering off; fastcgi_request_buffering off;
} }
...@@ -688,18 +691,7 @@ server { ...@@ -688,18 +691,7 @@ server {
# Adding the cache control header for js and css files # Adding the cache control header for js and css files
# Make sure it is BELOW the PHP block # Make sure it is BELOW the PHP block
location ~* \.(?:css|js)$ { location ~* \.(?:css|js)$ {
try_files \$uri /index.php\$uri\$is_args\$args; try_files $uri $uri/ /index.php$request_uri;
add_header Cache-Control "public, max-age=7200";
# Add headers to serve security related headers (It is intended to
# have those duplicated to the ones above)
add_header X-Content-Type-Options nosniff;
add_header X-Frame-Options "SAMEORIGIN";
add_header X-XSS-Protection "1; mode=block";
add_header X-Robots-Tag none;
add_header X-Download-Options noopen;
add_header X-Permitted-Cross-Domain-Policies none;
# Optional: Don't log access to assets
access_log off;
} }
location ~* \.(?:svg|gif|png|html|ttf|woff|ico|jpg|jpeg)$ { location ~* \.(?:svg|gif|png|html|ttf|woff|ico|jpg|jpeg)$ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment