D
D
Dmitry Sonko2015-01-26 16:16:13
Nginx
Dmitry Sonko, 2015-01-26 16:16:13

How to configure API versioning in nginx?

There is an API for the application. The current version is 1.1. The application accesses it at: site.com/1.1/users The next version needs to be transferred to another framework, the root document should change accordingly and access will be at
site.com/1.2/users
document root and rewrite? If you use just the form:

location /1.1/ {
    root /var/www/api/1.1;
    try_files $uri $uri/ index.php$is_args$args;
}

location /1.2/ {
    root /var/www/api/1.2;
    try_files $uri $uri/ index.php$is_args$args;
}

Then the errors FastCGI sent in stderr: "Primary script unknown" are poured into the log

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question