mirror of
				https://github.com/iiab/iiab.git
				synced 2025-03-09 15:40:17 +00:00 
			
		
		
		
	convert wp to native nginx
This commit is contained in:
		
							parent
							
								
									7508b770f0
								
							
						
					
					
						commit
						374c63c27f
					
				
					 3 changed files with 26 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -101,6 +101,12 @@
 | 
			
		|||
    dest: "/etc/{{ apache_config_dir }}/wordpress.conf"
 | 
			
		||||
  when: apache_enabled
 | 
			
		||||
 | 
			
		||||
- name: Install {{ nginx_config_dir }}/wordpress-nginx.conf from template, for http://box{{ wp_url }}
 | 
			
		||||
  template:
 | 
			
		||||
    src: wordpress-nginx.conf.j2
 | 
			
		||||
    dest: "{{ nginx_config_dir }}/wordpress-nginx.conf"
 | 
			
		||||
  when: nginx_enabled
 | 
			
		||||
 | 
			
		||||
- name: Add 'wordpress_installed' variable values to {{ iiab_state_file }}
 | 
			
		||||
  lineinfile:
 | 
			
		||||
    dest: "{{ iiab_state_file }}"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										19
									
								
								roles/wordpress/templates/wordpress-nginx.conf.j2
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										19
									
								
								roles/wordpress/templates/wordpress-nginx.conf.j2
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,19 @@
 | 
			
		|||
location {{ wp_url }} { 
 | 
			
		||||
    #rewrite_log on;
 | 
			
		||||
    root {{ content_base }};
 | 
			
		||||
    
 | 
			
		||||
    location ~ .*\.php$ {
 | 
			
		||||
          
 | 
			
		||||
          include fastcgi_params;
 | 
			
		||||
          fastcgi_pass php;
 | 
			
		||||
          fastcgi_index index.php;         
 | 
			
		||||
          fastcgi_param   SCRIPT_FILENAME    $document_root$fastcgi_script_name;          
 | 
			
		||||
       }
 | 
			
		||||
    
 | 
			
		||||
    location ~ ^({{ wp_url }})(/.*)/$ {           
 | 
			
		||||
          include fastcgi_params;
 | 
			
		||||
          fastcgi_pass php;
 | 
			
		||||
          fastcgi_index index.php;          
 | 
			
		||||
          fastcgi_param   SCRIPT_FILENAME    {{ wp_abs_path }}/index.php;          
 | 
			
		||||
       }         
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -240,7 +240,7 @@ nginx_port: "80"
 | 
			
		|||
nginx_interface: "0.0.0.0"
 | 
			
		||||
nginx_install: True
 | 
			
		||||
nginx_enabled: True
 | 
			
		||||
 | 
			
		||||
nginx_config_dir: /etc/nginx/conf.d
 | 
			
		||||
 | 
			
		||||
# See also Apache vars {default_language, language_priority} @ top of this file
 | 
			
		||||
#
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue