Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
173 views
in Technique[技术] by (71.8m points)

Deleting an environmental variable for IIS

I've understood that, in order to make IIS read a new environmental variable, I have to reset it via an administrator's command:

iireset /restart

I know that one can also restart IIS from the admin panel at server level. More context to my complete web app setup in my previous question/answer: in brief it is a Python Flask app running on IIS through WSGI and FastCGI.

What is still surprising me is that now, if I delete a previously created environmental variable, IIS keep seeing it, even after restarting it, as done above.

Why is that possibly happening? And how should I delete the variable for IIS?

question from:https://stackoverflow.com/questions/65871980/deleting-an-environmental-variable-for-iis

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

If you insist that you want to go with environmental variables (notice that you also have the alternative .env file), then you need to set them via the IIS FastCGI Settings from the IIS admin at server level for your specific application (the one you enabled via wfastcgi-enable).

Edit the specific row as said above and you'll find the Environment Variables collection under the "General" group of FastCGI Properties.

Now you can add and delete any of those variables and it will take effect immediately, without the need of any IIS reboot.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...