Compare Apache conf files and Nginx conf files: Difference between revisions
Jump to navigation
Jump to search
(Created page with "<pre> Apache Nginx <VirtualHost *:80> server { listen 80; ServerName yoursite.com ServerAlias www.yoursite.com server_name yoursite.com www.yoursite.com; DocumentRoot /path...") |
mNo edit summary |
||
Line 1: | Line 1: | ||
APACHE: | |||
<pre> | <pre> | ||
Apache Nginx | Apache Nginx | ||
Line 22: | Line 23: | ||
</pre> | </pre> | ||
NGINX: | |||
<pre> | <pre> | ||
server { | server { |
Latest revision as of 19:54, 23 February 2021
APACHE:
Apache Nginx <VirtualHost *:80> server { listen 80; ServerName yoursite.com ServerAlias www.yoursite.com server_name yoursite.com www.yoursite.com; DocumentRoot /path/to/root root /path/to/root; AllowOverride All <span class=“highlight”>(No Available Alternative)</span> DirectoryIndex index.php index index.php; ErrorLog /path/to/log error_log /path/to/log error; CustomLog /path/to/log combined access_log /path/to/log main; Alias /url/ “/path/to/files” location /url/ { <Directory “/path/to/files”> alias /path/to/files;
NGINX:
server { listen 8000; # We’re deliberately leaving this as-is to avoid conflict at the moment root /var/www; server_name <span class="highlight">your_site.com</span> www.<span class="highlight">your_site.com</span>; location / { try_files $uri $uri/ /index.html; } location ~ \.php$ { fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_index index.php; include fastcgi_params; } location /doc/ { alias /usr/share/doc/; autoindex on; allow 127.0.0.1; deny all; } location ~/\.ht { deny all; } }