Created
August 27, 2018 07:06
-
-
Save AndiSusanto15/fcddd396a6086098e8db0b202ef22b24 to your computer and use it in GitHub Desktop.
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
Todo: | |
- Config server nginx-fpm | |
- Create new server block for codeigniter | |
- Adjust codeigniter setting | |
- Config server nginx-fpm => Read previous Gist | |
- Create new server block for codeigniter | |
###START CONFIG FILE### | |
server { | |
listen 80; | |
server_name learnci.io; # managed by Certbot | |
root /home/vagrant/public_html/learnci.io; | |
error_log /var/log/nginx/learnci.io-error.log; | |
access_log /var/log/nginx/learnci.io-access.log; | |
# Load configuration files for the default server block. | |
include /etc/nginx/default.d/*.conf; | |
index index.php; | |
location = /favicon.ico { | |
log_not_found off; | |
access_log off; | |
} | |
location = /robots.txt { | |
allow all; | |
log_not_found off; | |
access_log off; | |
} | |
location ~ /\. { | |
deny all; | |
} | |
location ~* /(?:uploads|files)/.*\.php$ { | |
deny all; | |
} | |
location / { | |
try_files $uri $uri/ /index.php?/$request_uri; | |
} | |
location ~* \.php$ { | |
include fastcgi.conf; | |
fastcgi_intercept_errors on; | |
fastcgi_pass fpm-vagrant; #ini di buat di /etc/nginx/conf.d/upstream.conf | |
fastcgi_buffers 256 16k; | |
fastcgi_buffer_size 128k; | |
fastcgi_busy_buffers_size 256k; | |
fastcgi_temp_file_write_size 256k; | |
} | |
location ~* \.(js|css|png|jpg|jpeg|gif|ico)(\?[0-9])?$ { | |
expires 30d; | |
log_not_found off; | |
access_log off; | |
} | |
error_page 404 /404.html; | |
location = 404.html { | |
root /var/www/html/404.html; | |
} | |
} | |
###END CONFIG FILE### | |
- Adjust Codeigniter Setting | |
- setting base url | |
- setting db cred |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment