테스트 사이트 - 개발 중인 베타 버전입니다

nginx설정에 짧은주소를 위해 해당소스를 추가했습니다. 채택완료

신아그니 2년 전 조회 2,357

#### 그누보드5 nginx rules BEGIN #####     if (!-e $request_filename) {         rewrite ^/shop/list-([0-9a-z]+)$ /shop/list.php?ca_id=$1&rewrite=1 break;         rewrite ^/shop/type-([0-9a-z]+)$ /shop/listtype.php?type=$1&rewrite=1 break;         rewrite ^/shop/([0-9a-zA-Z_\-]+)$ /shop/item.php?it_id=$1&rewrite=1 break;         rewrite ^/shop/([^/]+)/$ /shop/item.php?it_seo_title=$1&rewrite=1 break;         rewrite ^/content/([0-9a-zA-Z_]+)$ /bbs/content.php?co_id=$1&rewrite=1 break;         rewrite ^/content/([^/]+)/$ /bbs/content.php?co_seo_title=$1&rewrite=1 break;         rewrite ^/rss/([0-9a-zA-Z_]+)$ /bbs/rss.php?bo_table=$1 break;         rewrite ^/([0-9a-zA-Z_]+)$ /bbs/board.php?bo_table=$1&rewrite=1 break;         rewrite ^/([0-9a-zA-Z_]+)/write$ /bbs/write.php?bo_table=$1&rewrite=1 break;         rewrite ^/([0-9a-zA-Z_]+)/([^/]+)/$ /bbs/board.php?bo_table=$1&wr_seo_title=$2&rewrite=1 break;         rewrite ^/([0-9a-zA-Z_]+)/([0-9]+)$ /bbs/board.php?bo_table=$1&wr_id=$2&rewrite=1 break;     }     #### 그누보드5 nginx rules END #####  

관리자에서 짧은주소 사용도 했는데 게시판 확장자가 빠져서나오는데

다른페이지들은 여전히 길게나옵니다. 

그후 재시작도하고 php도 재시작 다했는데 여전히 

https://domain/bbs/member_confirm.php?url=https://domain/bbs/register_form.php 

이런형식으로 계속 길게 나오는데 방법이 있을까요?

댓글을 작성하려면 로그인이 필요합니다.

답변 2개

채택된 답변
+20 포인트
들레아빠

00-default.conf

</p>

<p>server {

    listen 83 default_server;

    listen 443 ssl default_server;

    server_name localhost ;

    root "D:/html/";

    

    index index.html index.htm index.php;

 

    # Access Restrictions

    allow       127.0.0.1;

    deny        all;

 

    include "D:/laragon/etc/nginx/alias/*.conf";</p>

<p>    location / {

        try_files $uri $uri/ =404;

        autoindex on;

    }

    

    if (!-e $request_filename){

    rewrite ^/shop/list-([0-9a-z]+)$ /shop/list.php?ca_id=$1&rewrite=1 break;

    rewrite ^/shop/type-([0-9a-z]+)$ /shop/listtype.php?type=$1&rewrite=1 break;

    rewrite ^/shop/([0-9a-zA-Z_\-]+)$ /shop/item.php?it_id=$1&rewrite=1 break;

    rewrite ^/shop/([^/]+)/$ /shop/item.php?it_seo_title=$1&rewrite=1 break;

    rewrite ^/content/([0-9a-zA-Z_]+)$ /bbs/content.php?co_id=$1&rewrite=1 break;

    rewrite ^/content/([^/]+)/$ /bbs/content.php?co_seo_title=$1&rewrite=1 break;

    rewrite ^/rss/([0-9a-zA-Z_]+)$ /bbs/rss.php?bo_table=$1 break;

    rewrite ^/([0-9a-zA-Z_]+)$ /bbs/board.php?bo_table=$1&rewrite=1 break;

    rewrite ^/([0-9a-zA-Z_]+)/$ /bbs/board.php?bo_table=$1&rewrite=1 break;

    rewrite ^/([0-9a-zA-Z_]+)/write$ /bbs/write.php?bo_table=$1&rewrite=1 break;

    rewrite ^/([0-9a-zA-Z_]+)/([^/]+)/$ /bbs/board.php?bo_table=$1&wr_seo_title=$2&rewrite=1 break;

    rewrite ^/([0-9a-zA-Z_]+)/([0-9]+)$ /bbs/board.php?bo_table=$1&wr_id=$2&rewrite=1 break;

    }

    

    location ~ \.php$ {

        include snippets/fastcgi-php.conf;

        fastcgi_pass php_upstream;        

        #fastcgi_pass unix:/run/php/php7.0-fpm.sock;

    }

    

    # Enable SSL

    ssl_certificate "D:/laragon/etc/ssl/laragon.crt";

    ssl_certificate_key "D:/laragon/etc/ssl/laragon.key";

    ssl_session_timeout 5m;

    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;

    ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv3:+EXP;

    ssl_prefer_server_ciphers on;

    

    

    charset utf-8;

    

    location = /favicon.ico { access_log off; log_not_found off; }

    location = /robots.txt  { access_log off; log_not_found off; }

    location ~ /\.ht {

        deny all;

    }

    

}</p>

<p>

로그인 후 평가할 수 있습니다

댓글을 작성하려면 로그인이 필요합니다.

보여주신 if문을 추가하였으나 여전히 그대로인데.. 완전 같진 않지만 나머지 설정은 비슷합니다.

rewrite 구문자체가 없어서

로그인 후 평가할 수 있습니다

댓글을 작성하려면 로그인이 필요합니다.

답변을 작성하려면 로그인이 필요합니다.

로그인