Created
December 17, 2017 09:54
-
-
Save sujalpatel2209/6cf47c965bebd809dce1445cead64252 to your computer and use it in GitHub Desktop.
Nginx Config For Codeigniter
This file contains 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 { | |
listen 80; | |
root /var/www/html/placement; | |
index index.html index.php index.htm; | |
server_name placement.webmobtech.com; | |
location / { | |
# Check if a file exists, or route it to index.php. | |
try_files $uri $uri/ /index.php; | |
} | |
location /wmtadmin { | |
# Check if a file exists, or route it to index.php. | |
try_files $uri $uri/ /wmtadmin/index.php; | |
} | |
location ~ \.php$ { | |
try_files $uri =404; | |
fastcgi_split_path_info ^(.+\.php)(/.+)$; | |
fastcgi_pass unix:/var/run/php/php7.0-fpm.sock; | |
fastcgi_index index.php; | |
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | |
include fastcgi_params; | |
} | |
listen 443 ssl; # managed by Certbot | |
ssl_certificate /etc/letsencrypt/live/placement.webmobtech.com/fullchain.pem; # managed by Certbot | |
ssl_certificate_key /etc/letsencrypt/live/placement.webmobtech.com/privkey.pem; # managed by Certbot | |
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot | |
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot | |
if ($scheme != "https") { | |
return 301 https://$host$request_uri; | |
} # managed by Certbot | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment