Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do I provide my nginx.conf #90

Open
ktalebian opened this issue Mar 20, 2019 · 1 comment
Open

How do I provide my nginx.conf #90

ktalebian opened this issue Mar 20, 2019 · 1 comment

Comments

@ktalebian
Copy link

I'm trying to use the tutorial and get my testing with Test::Nginx started. Here is what I saw

use Test::Nginx::Socket 'no_plan';

run_tests();

__DATA__

=== TEST 1: hello, world
This is just a simple demonstration of the
echo directive provided by ngx_http_echo_module.
--- config
location = /t {
    echo "hello, world!";
}
--- request
GET /t
--- response_body
hello, world!
--- error_code: 200

I don't understand how I can use my own server/nginx.cnf to run the tests? This is already starting a server and doing the test. I already have an nginx.cnf that I like to include. How do I do that?

@woodgear
Copy link
Contributor

take a look here

sub write_config_file ($$$) {

to fully control the nginx.conf, you may want to use sth like this https://github.com/apache/apisix/blob/912bbbb3e1b0199c42b475f47952a2deac3a3366/t/APISIX.pm#L218

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants