-
-
Save he426100/47f623c58b17c1bd55bbfdd6468f106f to your computer and use it in GitHub Desktop.
X3 NGINX config
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| server { | |
| # Basic NGINX site setup | |
| listen 80; | |
| server_name yourwebsite.com; | |
| # Location where X3 is installed | |
| root /var/www/yourwebsite; | |
| # index.php as index | |
| index index.php; | |
| # X3 rewrite rules | |
| location / { | |
| if (!-e $request_filename){ | |
| # Rewrite any calls to html|json|xml|atom|rss if a folder matching * exists | |
| rewrite (.+)\.(html|json|xml|atom|rss)$ $1/ last; | |
| # Rewrite any calls to /render to the X3 image resizer | |
| rewrite ^/render/. /app/parsers/slir/ last; | |
| # Rewrite routes to X3 application index.php if they are non-existent files/dirs | |
| rewrite ^(.*)$ /index.php?$1 last; | |
| } | |
| } | |
| # Prevent web access to X3 /config and /_cache directories | |
| location ~ /(config|_cache) { | |
| deny all; | |
| } | |
| # PHP [OPTIONAL] | |
| # PHP setup may vary, but you should already have PHP working for NGINX or for a website. | |
| # Likely you may have a php.conf file to include. | |
| location ~ \.php$ { | |
| fastcgi_split_path_info ^(.+\.php)(/.+)$; | |
| # With php5-cgi alone: | |
| fastcgi_pass 127.0.0.1:9000; | |
| # With php5-fpm: | |
| # fastcgi_pass unix:/var/run/php5-fpm.sock; | |
| fastcgi_index index.php; | |
| fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | |
| include fastcgi_params; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment