You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The feature branch deployment supports both **Apache** and **nginx** as web server. The deployment tooling itself is web server agnostic — it uses filesystem symlinks for URL shortening and does not generate or depend on any web server configuration files.
4
+
5
+
## Apache
6
+
7
+
Apache works with minimal effort because TYPO3 and Symfony ship with `.htaccess` files that handle URL rewriting per directory. When a new feature branch is deployed, the application's `.htaccess` is available immediately without any web server restart or configuration change.
8
+
9
+
The only requirement is that `AllowOverride All` is set for the document root in the vhost configuration.
10
+
11
+
## nginx
12
+
13
+
Since nginx does not support per-directory configuration files like `.htaccess`, the URL rewriting and PHP routing must be defined in the server block configuration. This requires a one-time setup that covers all current and future feature branch instances.
14
+
15
+
### Prerequisites
16
+
17
+
1.**Symlinks** must be followed (this is the nginx default). Ensure `disable_symlinks` is **not** set to `on`.
18
+
19
+
2.**PHP-FPM** must be configured to process `.php` files in subdirectories, not just the document root.
20
+
21
+
3.**URL rewriting** for the application (TYPO3 or Symfony) must be handled in the server block, since there is no `.htaccess` to fall back on.
22
+
23
+
### Example for TYPO3
24
+
25
+
```nginx
26
+
server {
27
+
listen 443 ssl;
28
+
server_name demo.local;
29
+
root /var/www/html;
30
+
index index.php index.html;
31
+
32
+
# Feature branch instances and main application
33
+
location / {
34
+
try_files $uri $uri/ @rewrite;
35
+
}
36
+
37
+
# Rewrite all non-file requests to the nearest index.php.
38
+
# Supports both root-level and feature branch subdirectory requests.
39
+
location @rewrite {
40
+
rewrite ^/([^/]+)/(.*)$ /$1/index.php last;
41
+
rewrite ^(.*)$ /index.php last;
42
+
}
43
+
44
+
# Deny access to protected directories across all instances
45
+
location ~ /(typo3conf|var|config)/ {
46
+
return 403;
47
+
}
48
+
49
+
# PHP-FPM for all .php files including subdirectories
50
+
location ~ \.php$ {
51
+
include fastcgi_params;
52
+
fastcgi_pass unix:/run/php/php-fpm.sock; # adjust to match your PHP-FPM pool socket
See also the official [TYPO3 nginx configuration guide](https://docs.typo3.org/m/typo3/reference-coreapi/main/en-us/Configuration/WebServer/Nginx.html) for application-specific details.
60
+
61
+
### Example for Symfony
62
+
63
+
```nginx
64
+
server {
65
+
listen 443 ssl;
66
+
server_name demo.local;
67
+
root /var/www/html;
68
+
index index.php index.html;
69
+
70
+
location / {
71
+
try_files $uri $uri/ @rewrite;
72
+
}
73
+
74
+
location @rewrite {
75
+
rewrite ^/([^/]+)/(.*)$ /$1/index.php last;
76
+
rewrite ^(.*)$ /index.php last;
77
+
}
78
+
79
+
location ~ \.php$ {
80
+
include fastcgi_params;
81
+
fastcgi_pass unix:/run/php/php-fpm.sock; # adjust to match your PHP-FPM pool socket
The web server user group might differ between Apache (`www-data`) and nginx (`nginx` or `www-data` depending on distribution). Adjust the deployer configuration accordingly:
0 commit comments