mirror of
				https://github.com/digitalocean/nginxconfig.io.git
				synced 2025-11-04 18:28:17 +08:00 
			
		
		
		
	location / moved to example.com, index_php flag
This commit is contained in:
		@@ -16,6 +16,7 @@
 | 
			
		||||
			cdn:				false,
 | 
			
		||||
			non_www:			true,
 | 
			
		||||
			php:				'7.2',
 | 
			
		||||
			index_php:			true,
 | 
			
		||||
			index_html:			false,
 | 
			
		||||
			wordpress:			false,
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -64,6 +64,12 @@
 | 
			
		||||
										<span class="info">non-www</span>
 | 
			
		||||
									</label>
 | 
			
		||||
								</div>
 | 
			
		||||
								<div class="form-check">
 | 
			
		||||
									<input class="form-check-input" type="checkbox" id="index_html" ng-model="data.index_html">
 | 
			
		||||
									<label class="form-check-label" for="index_html">
 | 
			
		||||
										<span class="info">index.html</span>
 | 
			
		||||
									</label>
 | 
			
		||||
								</div>
 | 
			
		||||
							</div>
 | 
			
		||||
						</div>
 | 
			
		||||
						<div class="card">
 | 
			
		||||
@@ -80,9 +86,9 @@
 | 
			
		||||
									</select>
 | 
			
		||||
								</div>
 | 
			
		||||
								<div class="form-check" ng-if="data.php !== 'off'">
 | 
			
		||||
									<input class="form-check-input" type="checkbox" id="index_html" ng-model="data.index_html">
 | 
			
		||||
									<label class="form-check-label" for="index_html">
 | 
			
		||||
										<span class="info">index.html</span>
 | 
			
		||||
									<input class="form-check-input" type="checkbox" id="index_php" ng-model="data.index_php">
 | 
			
		||||
									<label class="form-check-label" for="index_php">
 | 
			
		||||
										<span class="info">index.php</span>
 | 
			
		||||
									</label>
 | 
			
		||||
								</div>
 | 
			
		||||
								<div class="form-check" ng-if="data.php !== 'off'">
 | 
			
		||||
 
 | 
			
		||||
@@ -1,11 +1,6 @@
 | 
			
		||||
# index
 | 
			
		||||
index {{ data.index_html ? 'index.html ' : '' }}index.php;
 | 
			
		||||
 | 
			
		||||
# process with {{ data.index_html ? 'index.html, ' : '' }}index.php
 | 
			
		||||
location / {
 | 
			
		||||
	try_files $uri $uri/ {{ data.index_html ? '/index.html ' : '' }}/index.php?$query_string;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
# handle .php
 | 
			
		||||
location ~ \.php$ {<span ng-if="data.file_structure === 'separated'">
 | 
			
		||||
	include _php_fastcgi.conf;
 | 
			
		||||
 
 | 
			
		||||
@@ -10,7 +10,11 @@ server {
 | 
			
		||||
 | 
			
		||||
	ssl_certificate /etc/letsencrypt/live/{{ data.domain }}/fullchain.pem;
 | 
			
		||||
	ssl_certificate_key /etc/letsencrypt/live/{{ data.domain }}/privkey.pem;
 | 
			
		||||
	ssl_trusted_certificate /etc/letsencrypt/live/{{ data.domain }}/fullchain.pem;
 | 
			
		||||
	ssl_trusted_certificate /etc/letsencrypt/live/{{ data.domain }}/fullchain.pem;<span ng-if="(data.php !== 'off' && data.index_php) || data.index_html">
 | 
			
		||||
 | 
			
		||||
	location / {
 | 
			
		||||
		try_files $uri $uri/ {{ data.index_html ? '/index.html' : '' }}{{ data.index_html && data.php !== 'off' && data.index_php ? ' ' : '' }}{{ data.php !== 'off' && data.index_php ? '/index.php?$query_string' : '' }};
 | 
			
		||||
	}</span>
 | 
			
		||||
	<span ng-if="data.file_structure === 'separated'">
 | 
			
		||||
	include _general.conf;<span ng-if="data.php !== 'off' && data.wordpress">
 | 
			
		||||
	include _wordpress.conf;</span><span ng-if="data.php !== 'off'">
 | 
			
		||||
@@ -96,7 +100,11 @@ server {
 | 
			
		||||
	server_name {{ !data.non_www ? 'www.' : '' }}{{ data.domain }};<span ng-if="data.php !== 'off'">
 | 
			
		||||
	set $base /var/www/{{ data.domain }};
 | 
			
		||||
	root $base{{ data.document_root }};</span><span ng-if="data.php === 'off'">
 | 
			
		||||
	root /var/www/{{ data.domain }}{{ data.document_root }};</span>
 | 
			
		||||
	root /var/www/{{ data.domain }}{{ data.document_root }};</span><span ng-if="(data.php !== 'off' && data.index_php) || data.index_html">
 | 
			
		||||
 | 
			
		||||
	location / {
 | 
			
		||||
		try_files $uri $uri/ {{ data.index_html ? '/index.html' : '' }}{{ data.index_html && data.php !== 'off' && data.index_php ? ' ' : '' }}{{ data.php !== 'off' && data.index_php ? '/index.php?$query_string' : '' }};
 | 
			
		||||
	}</span>
 | 
			
		||||
	<span ng-if="data.file_structure === 'separated'">
 | 
			
		||||
	include _general.conf;<span ng-if="data.php !== 'off' && data.wordpress">
 | 
			
		||||
	include _wordpress.conf;</span><span ng-if="data.php !== 'off'">
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user