I am also having this issue with Jenkins 2.249.2. Submitting a build using the python-jenkins module results in a 403 error from Jenkins which is behind an nginx proxy. The same request submitted using the HTTP GET method *will* work as shown below.
I also created a simple test script based on the lib_ci.py module from pagure which also receives a 403 error when submitting a build. The script is attached for reference.
I am also having this issue with Jenkins 2.249.2. Submitting a build using the python-jenkins module results in a 403 error from Jenkins which is behind an nginx proxy. The same request submitted using the HTTP GET method *will* work as shown below.
# 997 curl -v -X POST 'https:/ /jenkins. example. com/job/ openssh/ buildWithParame ters?cause= Test+Build& REPO=git% 3A%2F%2Fpagure. example. com%2Fpuppet% 2Fopenssh. git&BRANCH= master& BRANCH_ TO=ssh_ template_ test&token= 0KNNDFLIGOBW5WY OP7GBG5TZ4ZZO0W PB'
# 998 curl -v -X GET 'https:/ /jenkins. example. com/job/ openssh/ buildWithParame ters?cause= Test+Build& REPO=git% 3A%2F%2Fpagure. example. com%2Fpuppet% 2Fopenssh. git&BRANCH= master& BRANCH_ TO=ssh_ template_ test&token= 0KNNDFLIGOBW5WY OP7GBG5TZ4ZZO0W PB'
#10.201.64.43 - - [13/Oct/ 2020:08: 53:28 -0400] "GET /job/openssh/ buildWithParame ters?cause= Test+Build& REPO=git% 3A%2F%2Fpagure. example. com%2Fpuppet% 2Fopenssh. git&BRANCH= master& BRANCH_ TO=ssh_ template_ test&token= 0KNNDFLIGOBW5WY OP7GBG5TZ4ZZO0W PB HTTP/1.1" 201 5 "-" "curl/7.29.0" "-"
#10.201.64.43 - - [13/Oct/ 2020:08: 53:11 -0400] "POST /job/openssh/ buildWithParame ters?cause= Test+Build& REPO=git% 3A%2F%2Fpagure. example. com%2Fpuppet% 2Fopenssh. git&BRANCH= master& BRANCH_ TO=ssh_ template_ test&token= 0KNNDFLIGOBW5WY OP7GBG5TZ4ZZO0W PB HTTP/1.1" 403 578 "-" "curl/7.29.0" "-"
I also created a simple test script based on the lib_ci.py module from pagure which also receives a 403 error when submitting a build. The script is attached for reference.