nginx config changed

This commit is contained in:
Hüseyin Mert 2020-04-15 06:43:31 +03:00
parent 964cc93a71
commit 4762e225ba
2 changed files with 20 additions and 6 deletions

12
nginx/Dockerfile Normal file
View File

@ -0,0 +1,12 @@
FROM nginx:alpine
ENV AKAUNTING_VERSION 2.0.8
RUN apk update && apk add --no-progress -q wget unzip
RUN wget https://github.com/akaunting/akaunting/releases/download/${AKAUNTING_VERSION}/Akaunting_${AKAUNTING_VERSION}-Stable.zip
RUN mkdir -p /var/www/akaunting
RUN unzip Akaunting_${AKAUNTING_VERSION}-Stable.zip -d /var/www/akaunting
RUN rm Akaunting_${AKAUNTING_VERSION}-Stable.zip
RUN chmod -R 777 /var/www/akaunting

View File

@ -1,12 +1,12 @@
server { server {
server_name akaunting.test; server_name akaunting;
listen 80 default_server; listen 80 default_server;
access_log /dev/stdout; access_log /dev/stdout;
error_log /dev/stdout; error_log /dev/stdout;
root /var/www/akaunting.test; root /var/www/akaunting;
index index.php index.html; index index.html index.htm index.php;
add_header X-Frame-Options "SAMEORIGIN"; add_header X-Frame-Options "SAMEORIGIN";
add_header X-XSS-Protection "1; mode=block"; add_header X-XSS-Protection "1; mode=block";
@ -20,7 +20,7 @@ server {
} }
# Prevent Direct Access To Protected Folders # Prevent Direct Access To Protected Folders
location ~ ^/(^app$|bootstrap|config|database|resources|routes|storage|tests|artisan) { location ~ ^/(^app$|bootstrap|config|database|overrides|resources|routes|storage|tests|artisan) {
deny all; deny all;
} }
@ -29,15 +29,17 @@ server {
deny all; deny all;
} }
error_page 404 /index.php;
location / { location / {
try_files $uri $uri/ /index.php?$query_string; try_files $uri $uri/ /index.php?$query_string;
gzip_static on;
} }
# Pass PHP Scripts To FastCGI Server
location ~ \.php$ { location ~ \.php$ {
try_files $uri =404; try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass app:9000; fastcgi_pass php:9000;
fastcgi_index index.php; fastcgi_index index.php;
include fastcgi_params; include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;