코드이그나이터 기반 PHP 오픈소스 게시판 : 씨아이보드

nginx설치 중 여쭤보고 싶은 것이 있어 질문 남깁니다. 부탁드립니다!

  • SoongsilMilhouse
  • 4
  • 4,227
  • 글주소
  • 12-06

안녕하세요

nginx + php 를 사용하려고 합니다.


CI보드는 git clone을 사용하여 설치하였고 /var/www/html 에 설치되어 있습니다. (html 디렉토리 안에 index.php가 있습니다.)

설치 후 http://www.ciboard.co.kr/manual/install 에 나와있는 메뉴얼에 따라

database.php, config.php, cb_config.php를 수정했지만 계속 403 forbidden이 나타납니다.


http://www.ciboard.co.kr/qna/p/1601 참고해서 아래와 같이 nginx.conf 설정했는데 동작이 안되네요 

조언 부탁드립니다.ㅜㅜ



nginx.conf

=======================================================

user ubuntu;

worker_processes auto;

pid /run/nginx.pid;

include /etc/nginx/modules-enabled/*.conf;


events {

worker_connections 768;

# multi_accept on;

}

http {

server {

listen 80;

server_name dotstackexp.io www.dotstackexp.io;

root /var/www/html;


#set same size as post_max_size(php.ini or php_admin_value).

client_max_body_size 10M;


location / {

index index.php index.html;

try_files $uri /index.html index.php;

}


# Allow Lets Encrypt Domain Validation Program

location ^~ /.well-known/acme-challenge/ {

allow all;

}


# Block dot file (.htaccess .htpasswd .svn .git .env and so on.)

location ~ /\. {

deny all;

}


# Block (log file, binary, certificate, shell script, sql dump file) access.

location ~* \.(log|binary|pem|enc|crt|conf|cnf|sql|sh|key)$ {

deny all;

}


# Block access

location ~* (composer\.json|contributing\.md|license\.txt|readme\.rst|readme\.md|readme\.txt|copyright|artisan|gulpfile\.js|package\.json|phpunit\.xml)$ {

deny all;

}


location = /favicon.ico {

log_not_found off;

access_log off;

}


location = /robots.txt {

log_not_found off;

access_log off;

}


# Block .php file inside upload folder. uploads(wp), files(drupal), data(gnuboard).

location ~* /(?:uploads|default/files|data)/.*\.php$ {

deny all;

}


# Add PHP handler

location ~ [^/]\.php(/|$) {

fastcgi_split_path_info ^(.+?\.php)(/.*)$;

if (!-f $document_root$fastcgi_script_name) {

return 404;

}


fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;

fastcgi_index index.php;

fastcgi_buffers 64 4k; # default 8 4k


include fastcgi_params;

}

}


##

# Basic Settings

##


sendfile on;

tcp_nopush on;

tcp_nodelay on;

keepalive_timeout 65;

types_hash_max_size 2048;

# server_tokens off;


# server_names_hash_bucket_size 64;

# server_name_in_redirect off;


include /etc/nginx/mime.types;

default_type application/octet-stream;


##

# SSL Settings

##


ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE

ssl_prefer_server_ciphers on;


##

# Logging Settings

##


access_log /var/log/nginx/access.log;

error_log /var/log/nginx/error.log;


##

# Gzip Settings

##


gzip on;


# gzip_vary on;

# gzip_proxied any;

# gzip_comp_level 6;

# gzip_buffers 16 8k;

# gzip_http_version 1.1;

# gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;


##

# Virtual Host Configs

##


include /etc/nginx/conf.d/*.conf;

include /etc/nginx/sites-enabled/*;


}

===================================================