@@ -421,29 +421,44 @@ all you need to do is to point the nginx' [`root`](http://nginx.org/en/docs/http
421421to instruct nginx to process any dynamic requests through X. This can be
422422achieved by using an nginx configuration with the following contents:
423423
424- ```
425- server {
426- # Serve static files from `public/`, proxy dynamic requests to Framework X
427- location / {
428- location ~* \.php$ {
424+ === "nginx.conf (reverse proxy with static files)"
425+
426+ ```
427+ server {
428+ # Serve static files from `public/`, proxy dynamic requests to Framework X
429+ location / {
430+ location ~* \.php$ {
431+ try_files /dev/null @x;
432+ }
433+ root /home/alice/projects/acme/public;
434+ try_files $uri @x;
435+ }
436+
437+ location @x {
438+ proxy_pass http://localhost:8080;
439+ proxy_set_header Host $host;
440+ proxy_set_header Connection "";
441+ }
442+
443+ # Optional: handle Apache config with Framework X if it exists in `public/`
444+ location ~ \.htaccess$ {
429445 try_files /dev/null @x;
430446 }
431- root /home/alice/projects/acme/public;
432- try_files $uri @x;
433447 }
448+ ```
434449
435- location @x {
436- proxy_pass http://localhost:8080;
437- proxy_set_header Host $host;
438- proxy_set_header Connection "";
439- }
450+ === "nginx.conf (minimal reverse proxy)"
440451
441- # Optional: handle Apache config with Framework X if it exists in `public/`
442- location ~ \.htaccess$ {
443- try_files /dev/null @x;
452+ ```
453+ server {
454+ # Proxy all requests to Framework X
455+ location / {
456+ proxy_pass http://localhost:8080;
457+ proxy_set_header Host $host;
458+ proxy_set_header Connection "";
459+ }
444460 }
445- }
446- ```
461+ ```
447462
448463> ℹ️ ** New to nginx?**
449464>
0 commit comments