Skip to content

Commit 29045e9

Browse files
committed
[ADD] Nginx config file.
1 parent 1e472b3 commit 29045e9

4 files changed

Lines changed: 50 additions & 27 deletions

File tree

.editorconfig

Lines changed: 0 additions & 26 deletions
This file was deleted.

assets/plugins/updater/plugin.updater.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,7 @@ function mmkDir($folder, $perm = 0777)
349349
removeFolder(__DIR__ . "/temp/" . $dir . "/install/assets/chunks");
350350
removeFolder(__DIR__ . "/temp/" . $dir . "/install/assets/tvs");
351351
removeFolder(__DIR__ . "/temp/" . $dir . "/install/assets/templates");
352+
unlink(__DIR__ . "/temp/" . $dir . "/ng.inx");
352353
unlink(__DIR__ . "/temp/" . $dir . "/ht.access");
353354
unlink(__DIR__ . "/temp/" . $dir . "/README.md");
354355
unlink(__DIR__ . "/temp/" . $dir . "/sample-robots.txt");

ht.access

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,15 @@
55

66
#php_flag register_globals Off
77
AddDefaultCharset utf-8
8-
#php_value date.timezone Europe/Moscow
8+
#php_value date.timezone Europe/Kyiv
99

1010
#Options +FollowSymlinks
1111
RewriteEngine On
12+
13+
# Block access to the contents of the Git directory
14+
RewriteCond %{REQUEST_URI} ^\/(.git|.hg|.idea|README.md)
15+
RewriteRule .* - [L,R=404]
16+
1217
RewriteBase /
1318

1419
# Fix Apache internal dummy connections from breaking [(site_url)] cache

ng.inx

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# You can enable a virtual host via a symbolic link
2+
# Rename this file at .nginx
3+
# sudo ln -s /{domain_path}/.nginx /etc/nginx/sites-enabled/
4+
5+
server {
6+
listen 80;
7+
listen [::]:80;
8+
server_name {domain} www.{domain}; # Change the {domain} as your domain name
9+
merge_slashes off;
10+
root /{domain_path}/; # Change the {domain_path} as your domain root path on this server
11+
12+
add_header X-Frame-Options "SAMEORIGIN";
13+
add_header X-XSS-Protection "1; mode=block";
14+
add_header X-Content-Type-Options "nosniff";
15+
16+
index index.php index.html;
17+
18+
access_log /{domain_path}/core/storage/logs/nginx-access.log; # Change the {domain_path} as your domain root path on this server
19+
client_max_body_size 512M;
20+
21+
error_page 404 /index.php?q=404;
22+
23+
location ~ /\. { access_log off; return 404; }
24+
location / { try_files $uri $uri/ @rewrite; }
25+
location /manager { rewrite ^/manager/(.*)$ /manager/index.php last; }
26+
location = /favicon.ico { access_log off; log_not_found off; }
27+
location = /robots.txt { access_log off; log_not_found off; }
28+
29+
location ~ \.php$ {
30+
try_files $uri @rewrite;
31+
include /etc/nginx/fastcgi.conf;
32+
fastcgi_pass unix:/run/php/php8.2-fpm.sock;
33+
}
34+
35+
location ~* \.(jpg|jpeg|gif|png|ico|css|bmp|swf|js|html|txt|svg|woff|woff2|ttf)$ {
36+
root /{domain_path}/; # Change the {domain_path} as your domain root path on this server
37+
expires max;
38+
}
39+
40+
location @rewrite {
41+
rewrite ^(.*)$ /index.php?q=$1&$args last;
42+
}
43+
}

0 commit comments

Comments
 (0)