Nginx Search Console 검증을 통해

Nginx Search Console 검증을 통해

저는 booking.com 제휴 파트너입니다. 리디렉션을 통해 요청을 booking.com으로 리디렉션할 수 있습니다. 이제 Google Search Console에서 내 사이트를 팔로우하고 싶습니다. 이러한 이유로 Google 유효성 검사 html 파일을 사용하여 내 사이트의 유효성을 검사하고 싶습니다. 이미 내 폴더에 업로드했는데 찾을 수 없습니다.

내 nginx 구성을 공유하고 있습니다. 미리 감사드립니다.

server {
    listen   80;

    server_name  www.example.com;
    if ($request_uri ~ .*.html.*) {
     rewrite ^/(.*)$ /home/example/google707f2904060d9180.html;
    }
     rewrite ^/(.*)$ https://www.booking.com/index.ru.html?aid=345793 redirect;

답변1

location / {
    return 301 https://www.booking.com...;
}

location = /google...html {
    try_files /google707f2904060d9180.html =404;
}

후자 location블록의 정확한 경로와 일치하는 요청을 제외한 다른 모든 요청은 여기로 리디렉션됩니다. 두 번째 블록은 파일을 제공합니다.

관련 정보